diff options
-rw-r--r-- | astroid/builder.py | 1 | ||||
-rw-r--r-- | astroid/raw_building.py | 12 | ||||
-rw-r--r-- | pylintrc | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/astroid/builder.py b/astroid/builder.py index 5aaab5c8..bc0a87db 100644 --- a/astroid/builder.py +++ b/astroid/builder.py @@ -39,6 +39,7 @@ def parse(string): return compile(string, "<string>", 'exec', PyCF_ONLY_AST) if sys.version_info >= (3, 0): + # pylint: disable=no-name-in-module; We don't understand flows yet. from tokenize import detect_encoding def open_source_file(filename): diff --git a/astroid/raw_building.py b/astroid/raw_building.py index 008f1207..73a7db4e 100644 --- a/astroid/raw_building.py +++ b/astroid/raw_building.py @@ -22,6 +22,7 @@ __docformat__ = "restructuredtext en" import sys +import logging import os from os.path import abspath from inspect import (getargspec, isdatadescriptor, isfunction, ismethod, @@ -34,11 +35,14 @@ from astroid.nodes import (Module, Class, Const, const_factory, From, Function, EmptyNode, Name, Arguments) from astroid.bases import BUILTINS, Generator from astroid.manager import AstroidManager -MANAGER = AstroidManager() + +MANAGER = AstroidManager() _CONSTANTS = tuple(CONST_CLS) # the keys of CONST_CLS eg python builtin types _JYTHON = os.name == 'java' _BUILTINS = vars(six.moves.builtins) +_LOG = logging.getLogger(__name__) + def _io_discrepancy(member): # _io module names itself `io`: http://bugs.python.org/issue18602 @@ -317,10 +321,8 @@ class InspectBuilder(object): try: modname = getattr(member, '__module__', None) except: # pylint: disable=bare-except - # XXX use logging - print('unexpected error while building astroid from living object') - import traceback - traceback.print_exc() + _LOG.exception('unexpected error while building ' + 'astroid from living object') modname = None if modname is None: if (name in ('__new__', '__subclasshook__') @@ -98,7 +98,7 @@ disable=invalid-name,protected-access,no-self-use,unused-argument, too-many-return-statements,redefined-outer-name,undefined-variable,
too-many-locals,method-hidden,duplicate-code,attribute-defined-outside-init,
fixme,missing-docstring,too-many-lines,too-many-statements,undefined-loop-variable,
- unpacking-non-sequence
+ unpacking-non-sequence,import-error,no-name-in-module
[BASIC]
@@ -1,6 +1,6 @@ [tox]
# official list is
-#envlist = py27, py33, py34
+#envlist = py27, py33, py34, pypy, jython
envlist = py27, py33, pylint
[testenv:pylint]
|