summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-05-31 17:29:34 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2016-05-31 17:29:48 +0100
commitcda9dc4ad0e2cc075553d133dd0fdab468d614d7 (patch)
tree9c7402a39f0685c83de9c2fe87d9c39d0c39526d /astroid/modutils.py
parent72cb2ddff884b7dc03dd8c8365b260caca4e80d8 (diff)
downloadastroid-git-cda9dc4ad0e2cc075553d133dd0fdab468d614d7.tar.gz
Canonicalize file paths in modpath_from_file, this should help when receiving symlinks and whatnot.
Close PyCQA/pylint#791
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r--astroid/modutils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py
index b890915d..24c72e6a 100644
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -297,8 +297,9 @@ def check_modpath_has_init(path, mod_path):
def modpath_from_file_with_callback(filename, extrapath=None, is_package_cb=None):
filename = _path_from_filename(filename)
- filename = os.path.abspath(filename)
+ filename = os.path.realpath(os.path.expanduser(filename))
base = os.path.splitext(filename)[0]
+
if extrapath is not None:
for path_ in extrapath:
path = os.path.abspath(path_)