summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--builder.py8
2 files changed, 5 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b9aa2a0..39e75453 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
diff --git a/builder.py b/builder.py
index 68bd5c30..eed4ed28 100644
--- a/builder.py
+++ b/builder.py
@@ -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