diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | builder.py | 8 |
2 files changed, 5 insertions, 6 deletions
@@ -2,6 +2,9 @@ Change log for the astng package ================================ -- + * #76159: putting module's parent directory on the path causes problems + linting when file names clash + * #74746: should return empty module when __main__ is imported (patch by google) @@ -121,18 +121,14 @@ class ASTNGBuilder(InspectBuilder): raise ASTNGBuildingException(exc) except LookupError, exc: # unknown encoding raise ASTNGBuildingException(exc) - # get module name if necessary, *before modifying sys.path* + # get module name if necessary if modname is None: try: modname = '.'.join(modpath_from_file(path)) except ImportError: modname = splitext(basename(path))[0] # build astng representation - try: - sys.path.insert(0, dirname(path)) # XXX (syt) iirk - node = self.string_build(data, modname, path) - finally: - sys.path.pop(0) + node = self.string_build(data, modname, path) node.file_encoding = encoding node.file_stream = stream return node |