Commits

Anonymous committed d70dc51

actions: guess standard library location by tracking os.py

  • Participants
  • Parent commits 0ff9009

Comments (0)

Files changed (1)

File rope/refactor/importutils/actions.py

     @classmethod
     def standard_modules(cls):
         if not hasattr(cls, '_standard_modules'):
+            import inspect
             result = set(sys.builtin_module_names)
-            if os.name != 'nt':
-                lib_path = os.path.join(
-                    sys.prefix, 'lib', 'python' + sys.version[:3])
-            else:
-                lib_path = os.path.join(sys.prefix, 'lib%s' % os.sep)
+            lib_path = os.path.dirname(inspect.getsourcefile(os))
             dynload_path = os.path.join(lib_path, 'lib-dynload')
             if os.path.exists(lib_path):
                 for name in os.listdir(lib_path):