diff options
| author | Brett Cannon <brett@python.org> | 2014-08-29 11:18:27 -0400 |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2014-08-29 11:18:27 -0400 |
| commit | 2a577c77f465d6ba207706933130e4a7007bac52 (patch) | |
| tree | 317e6856b6df6a00a99af1d422375ed88d394326 | |
| parent | 131810f8df6431ffef5d0cf345d67aeec7c3c605 (diff) | |
| download | pylint-2a577c77f465d6ba207706933130e4a7007bac52.tar.gz | |
Also modernize pyreverse
| -rw-r--r-- | pyreverse/diadefslib.py | 2 | ||||
| -rw-r--r-- | pyreverse/main.py | 3 | ||||
| -rw-r--r-- | pyreverse/utils.py | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/pyreverse/diadefslib.py b/pyreverse/diadefslib.py index 46d0f19..f0456ff 100644 --- a/pyreverse/diadefslib.py +++ b/pyreverse/diadefslib.py @@ -198,7 +198,7 @@ class ClassDiadefGenerator(DiaDefGenerator): else: module = project.modules[0] klass = klass.split('.')[-1] - klass = module.ilookup(klass).next() + klass = next(module.ilookup(klass)) anc_level, ass_level = self._get_levels() self.extract_classes(klass, anc_level, ass_level) diff --git a/pyreverse/main.py b/pyreverse/main.py index d4991b5..408c172 100644 --- a/pyreverse/main.py +++ b/pyreverse/main.py @@ -18,6 +18,7 @@ create UML diagrams for classes and modules in <packages> """ +from __future__ import print_function import sys, os from logilab.common.configuration import ConfigurationMixIn @@ -99,7 +100,7 @@ class Run(ConfigurationMixIn): def run(self, args): """checking arguments and run project""" if not args: - print self.help() + print(self.help()) return 1 # insert current working directory to the python path to recognize # dependencies to local modules even if cwd is not in the PYTHONPATH diff --git a/pyreverse/utils.py b/pyreverse/utils.py index 3d12d41..58559d7 100644 --- a/pyreverse/utils.py +++ b/pyreverse/utils.py @@ -16,6 +16,7 @@ """ generic classes/functions for pyreverse core/extensions """ +from __future__ import print_function import sys import re @@ -118,8 +119,8 @@ class FilterMixIn(object): for nummod in mode.split('+'): try: __mode += MODES[nummod] - except KeyError, ex: - print >> sys.stderr, 'Unknown filter mode %s' % ex + except KeyError as ex: + print('Unknown filter mode %s' % ex, file=sys.stderr) self.__mode = __mode |
