summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-24 14:30:23 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-24 14:30:23 +0300
commitf64685adc7b62e34005cb1b8d0f09403d7db6259 (patch)
tree5c6579d49b8efbaf7a55e32c3dcb012253c47bd8 /astroid
parentaa7598db9e93232450482f6f28a71507aa258106 (diff)
downloadastroid-f64685adc7b62e34005cb1b8d0f09403d7db6259.tar.gz
Fix Pylint warnings over astroid.
Diffstat (limited to 'astroid')
-rw-r--r--astroid/builder.py1
-rw-r--r--astroid/raw_building.py12
2 files changed, 8 insertions, 5 deletions
diff --git a/astroid/builder.py b/astroid/builder.py
index 5aaab5c..bc0a87d 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 008f120..73a7db4 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__')