[code-quality] Lots of E1101 in standard modules after upgrading pylint to 1.4.0

Paul Smith paul at mad-scientist.net
Wed Nov 26 23:14:57 CET 2014


On Wed, 2014-11-26 at 17:04 -0500, Paul Smith wrote:
> If I reset STD_LIB_DIRS like this:
> 
> >>> modutils.STD_LIB_DIRS = ['/opt/python/lib/python2.7',
> '/opt/python/x86_64-linux/lib/python2.7']
> 
> Then I get:
> 
> >>> modutils.is_standard_module('time')
> True

OK, if I apply the patch below to astroid it seems to fix the problem...
not sure if this is correct or not.

--- a/astroid/modutils.py	2014-11-26 17:07:17.110110766 -0500
+++ b/astroid/modutils.py	2014-11-26 17:07:47.846275548 -0500
@@ -66,7 +66,7 @@
     # off the detection logic for standard library modules, thus the
     # workaround.
     STD_LIB_DIRS = [
-        get_python_lib(standard_lib=True, prefix=sys.prefix),
+        get_python_lib(standard_lib=True, prefix=sys.exec_prefix),
         get_python_lib(standard_lib=True)]
     if os.name == 'nt':
         STD_LIB_DIRS.append(os.path.join(sys.prefix, 'dlls'))




More information about the code-quality mailing list