Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: third_party/logilab/common/optparser.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/common/deprecation.py ('k') | third_party/logilab/common/pytest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/optparser.py
diff --git a/third_party/logilab/common/optparser.py b/third_party/logilab/common/optparser.py
index 0263dab658945fcd0981c1c27be1d5fcf747d097..aa17750ed42cd3a8a5ae9998b089fb6e6bc08eba 100644
--- a/third_party/logilab/common/optparser.py
+++ b/third_party/logilab/common/optparser.py
@@ -29,6 +29,8 @@ Example:
With mymod.build that defines two functions run and add_options
"""
+from __future__ import print_function
+
__docformat__ = "restructuredtext en"
from warnings import warn
@@ -55,9 +57,9 @@ class OptionParser(optparse.OptionParser):
def print_main_help(self):
optparse.OptionParser.print_help(self)
- print '\ncommands:'
+ print('\ncommands:')
for cmdname, (_, help) in self._commands.items():
- print '% 10s - %s' % (cmdname, help)
+ print('% 10s - %s' % (cmdname, help))
def parse_command(self, args):
if len(args) == 0:
@@ -78,7 +80,7 @@ class OptionParser(optparse.OptionParser):
# optparse inserts self.description between usage and options help
self.description = help
if isinstance(mod_or_f, str):
- exec 'from %s import run, add_options' % mod_or_f
+ exec('from %s import run, add_options' % mod_or_f)
else:
run, add_options = mod_or_f
add_options(self)
« no previous file with comments | « third_party/logilab/common/deprecation.py ('k') | third_party/logilab/common/pytest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698