Commits

Boris FELD committed 0fc805b

Fix checkers.utils for other implementations (use of __builtins__). Closes #99139. Closes #89838. Theses fixes need fixes on logilab-astng and logilab-common

  • Participants
  • Parent commits 014e44b

Comments (0)

Files changed (1)

File checkers/utils.py

     current = node
     while current and not isinstance(current.parent, astng.ExceptHandler):
         current = current.parent
-    
+
     return current and current is current.parent.name
 
 
     """return true if the given node does nothing but 'pass'"""
     return len(body) == 1 and isinstance(body[0], astng.Pass)
 
-builtins =  __builtins__.copy()
+builtins = builtins.__dict__.copy()
 SPECIAL_BUILTINS = ('__builtins__',) # '__path__', '__file__')
 
 def is_builtin(name): # was is_native_builtin
     at most one trailing underscore)
     """
     regex = re.compile('^_{2,}.*[^_]+_?$')
-    return regex.match(attrname)
+    return regex.match(attrname)