diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-06-17 10:27:15 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-06-17 10:27:15 +0300 |
commit | c16be8e421f4080b8f8fa26882aaaabb52220fa4 (patch) | |
tree | 10faf7fb11de46bf361963cf09a4f071e3980eb5 | |
parent | b250b787791e10f87e252198fea835fc861ded14 (diff) | |
download | astroid-c16be8e421f4080b8f8fa26882aaaabb52220fa4.tar.gz |
Fix a couple of pylint warnings.
-rw-r--r-- | astroid/brain/py2gi.py | 6 | ||||
-rw-r--r-- | astroid/tests/unittest_inference.py | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/astroid/brain/py2gi.py b/astroid/brain/py2gi.py index 75b9981..2f8494d 100644 --- a/astroid/brain/py2gi.py +++ b/astroid/brain/py2gi.py @@ -47,7 +47,7 @@ def _gi_build_stub(parent): elif (inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)): methods[name] = obj - elif type(obj) in [int, str]: + elif isinstance(obj, (int, str)): constants[name] = obj elif (str(obj).startswith("<flags") or str(obj).startswith("<enum ") or @@ -74,7 +74,7 @@ def _gi_build_stub(parent): val = constants[name] strval = str(val) - if type(val) is str: + if isinstance(val, str): strval = '"%s"' % str(val).replace("\\", "\\\\") ret += "%s = %s\n" % (name, strval) @@ -83,7 +83,6 @@ def _gi_build_stub(parent): if functions: ret += "# %s functions\n\n" % parent.__name__ for name in sorted(functions): - func = functions[name] ret += "def %s(*args, **kwargs):\n" % name ret += " pass\n" @@ -92,7 +91,6 @@ def _gi_build_stub(parent): if methods: ret += "# %s methods\n\n" % parent.__name__ for name in sorted(methods): - func = methods[name] ret += "def %s(self, *args, **kwargs):\n" % name ret += " pass\n" diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py index a1fe387..e34aa53 100644 --- a/astroid/tests/unittest_inference.py +++ b/astroid/tests/unittest_inference.py @@ -2338,7 +2338,7 @@ class TestCallable(unittest.TestCase): (''' class C1: def meth(self): pass - callable(C1) #@''', True), + callable(C1) #@''', True), ] for code, expected_value in expected: node = test_utils.extract_node(code) @@ -2398,7 +2398,7 @@ class TestCallable(unittest.TestCase): for node in ast_nodes: inferred = next(node.infer()) self.assertFalse(inferred.value) - + if __name__ == '__main__': unittest.main() |