Skip to content

Commit

Permalink
Canonicalize file paths in modpath_from_file, this should help when r…
Browse files Browse the repository at this point in the history
…eceiving symlinks and whatnot.

Close #791
  • Loading branch information
PCManticore committed May 31, 2016
1 parent 72cb2dd commit cda9dc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion astroid/modutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down

0 comments on commit cda9dc4

Please sign in to comment.