summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
diff options
context:
space:
mode:
authorDerek Gustafson <degustaf@gmail.com>2016-11-30 15:19:15 +0000
committerClaudiu Popa <pcmanticore@gmail.com>2016-12-03 13:07:03 +0200
commitac3e82e9bd8678086325a71a927a06bbc43d415e (patch)
treec3083323ff3518c414d75b1c424eb7432b6b94e1 /astroid/modutils.py
parent60743e7e19f319af951948a3fcc2804f980293d3 (diff)
downloadastroid-git-ac3e82e9bd8678086325a71a927a06bbc43d415e.tar.gz
Remove pylint errors
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r--astroid/modutils.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py
index eb7673a6..f17bfdab 100644
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -26,15 +26,10 @@ import sys
from distutils.sysconfig import get_python_lib # pylint: disable=import-error
# pylint: disable=import-error, no-name-in-module
from distutils.errors import DistutilsPlatformError
-# pylint: disable=wrong-import-order
# distutils is replaced by virtualenv with a module that does
# weird path manipulations in order to get to the
# real distutils module.
-try:
- import pkg_resources
-except ImportError:
- pkg_resources = None
import six
from .interpreter._import import spec
@@ -384,7 +379,7 @@ def file_info_from_modpath(modpath, path=None, context_file=None):
return _spec_from_modpath(modpath, path, context)
elif modpath == ['os', 'path']:
# FIXME: currently ignoring search_path...
- return spec.ModuleSpec(name='os.path', location=os.path.__file__, type=imp.PY_SOURCE)
+ return spec.ModuleSpec(name='os.path', location=os.path.__file__, module_type=imp.PY_SOURCE)
return _spec_from_modpath(modpath, path, context)
@@ -595,7 +590,7 @@ def _spec_from_modpath(modpath, path=None, context=None):
this function is used internally, see `file_from_modpath`'s
documentation for more information
"""
- assert len(modpath) > 0
+ assert modpath
location = None
if context is not None:
try:
@@ -609,7 +604,7 @@ def _spec_from_modpath(modpath, path=None, context=None):
if found_spec.type == spec.ModuleType.PY_COMPILED:
try:
location = get_source_file(found_spec.location)
- return found_spec._replace(location=location, type=spec.ModuleSpec.PY_SOURCE)
+ return found_spec._replace(location=location, type=spec.ModuleType.PY_SOURCE)
except NoSourceFile:
return found_spec._replace(location=location)
elif found_spec.type == spec.ModuleType.C_BUILTIN: