@@ -502,14 +502,8 @@ def _hit_from_first_part(self, tokens, scoperef):
502502 scoperef = (self .built_in_blob , [])
503503 return (self .built_in_blob , scoperef ), 1
504504
505- elem = self ._elem_from_scoperef (scoperef )
506- if first_token == elem .get ("name" ):
507- # The element itself is the thing we wanted...
508- self .log ("is '%s' accessible on %s? yes: %s" ,
509- first_token , scoperef , elem )
510- return (elem , scoperef ), 1
511-
512505 while 1 :
506+ elem = self ._elem_from_scoperef (scoperef )
513507 if first_token in elem .names :
514508 #TODO: skip __hidden__ names
515509 self .log ("is '%s' accessible on %s? yes: %s" ,
@@ -523,11 +517,16 @@ def _hit_from_first_part(self, tokens, scoperef):
523517 '.' .join (tokens [:nconsumed ]), scoperef , hit [0 ])
524518 return hit , nconsumed
525519
520+ if first_token == elem .get ("name" ):
521+ # The element itself is the thing we wanted...
522+ self .log ("is '%s' accessible on %s? yes: %s" ,
523+ first_token , scoperef , elem )
524+ return (elem , scoperef ), 1
525+
526526 self .log ("is '%s' accessible on %s? no" , first_token , scoperef )
527527 scoperef = self .parent_scoperef_from_scoperef (scoperef )
528528 if not scoperef :
529529 return None , None
530- elem = self ._elem_from_scoperef (scoperef )
531530
532531 def _set_reldirlib_from_blob (self , blob ):
533532 """Set the relative import directory to be this blob's location."""
0 commit comments