Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

script.get_definition error in dev head (6a98aaf) #60

Closed
tkf opened this Issue Nov 13, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Collaborator

tkf commented Nov 13, 2012

I get this in

In [18]:
source = """\
def function(alpha, beta):
    pass
function(alpha='one', beta='two')
"""
script = jedi.Script(source, 3, 0, '')
definitions = script.get_definition()
definitions

Truncated Traceback (Use C-c C-x to view full TB):
/home/takafumi/repos/watch/jedi/jedi/parsing.py in name(self)
    300             sep = (os.path.sep,) * 2
    301             r = re.search(r'([^%s]+?)(%s__init__)?(\.py)?$' % sep, self.path)
--> 302             string = r.group(1)
    303         names = [(string, (0, 0))]
    304         self._name = Name(names, self.start_pos, self.end_pos, self)

AttributeError: 'NoneType' object has no attribute 'group'
Collaborator

tkf commented Nov 13, 2012

In 0.5b3

In [3]:
source = """\
def function(alpha, beta):
    pass
function(alpha='one', beta='two')
"""
script = jedi.Script(source, 3, 0, '')
definitions = script.get_definition()
definitions
Out [3]:
[<Definition def function>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment