Commits

Victor Stinner committed d7fe24b

Fix "from math import *": ignore attributes starting with "_"

  • Participants
  • Parent commits 4b2a705

Comments (0)

Files changed (1)

astoptimizer/optimizer.py

         if hasattr(module, '__all__'):
             all_attributes = module.__all__
         else:
-            all_attributes = dir(module)
+            all_attributes = [name for name in dir(module)
+                              if not name.startswith('_')]
         all_attributes = set(all_attributes) - set(('__doc__', '__name__', '__package__'))
         for attr in all_attributes:
             qualname = "%s.%s" % (module_name, attr)