diff options
| author | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
| commit | 4a612db8e89afed74173b93f3b64fa567b8417a3 (patch) | |
| tree | 81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/commands/cli_qfile.py | |
| parent | 84af79988a4e916604cba31843778206efb7d1b8 (diff) | |
| parent | de181c1a40965a3a7deedd56a034a946f45b6984 (diff) | |
| download | mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip | |
Diffstat (limited to 'src/mailman/commands/cli_qfile.py')
| -rw-r--r-- | src/mailman/commands/cli_qfile.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mailman/commands/cli_qfile.py b/src/mailman/commands/cli_qfile.py index 986898bee..e502deac8 100644 --- a/src/mailman/commands/cli_qfile.py +++ b/src/mailman/commands/cli_qfile.py @@ -17,24 +17,22 @@ """Getting information out of a qfile.""" -from __future__ import absolute_import, print_function, unicode_literals - -__metaclass__ = type __all__ = [ 'QFile', ] -import cPickle - -from pprint import PrettyPrinter -from zope.interface import implementer +import six from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand from mailman.utilities.interact import interact +from pprint import PrettyPrinter +from six.moves import cPickle +from zope.interface import implementer +# This is deliberately called 'm' for use with --interactive. m = [] @@ -71,7 +69,7 @@ class QFile: """See `ICLISubCommand`.""" printer = PrettyPrinter(indent=4) assert len(args.qfile) == 1, 'Wrong number of positional arguments' - with open(args.qfile[0]) as fp: + with open(args.qfile[0], 'rb') as fp: while True: try: m.append(cPickle.load(fp)) @@ -82,7 +80,7 @@ class QFile: for i, obj in enumerate(m): count = i + 1 print(_('<----- start object $count ----->')) - if isinstance(obj, basestring): + if isinstance(obj, six.string_types): print(obj) else: printer.pprint(obj) |
