diff options
author | Michael Klishin <michael@clojurewerkz.org> | 2017-05-03 19:33:42 +0200 |
---|---|---|
committer | Michael Klishin <michael@clojurewerkz.org> | 2017-05-03 19:33:42 +0200 |
commit | 16f058decb14318b3dc1e88f6f6487dac38d30de (patch) | |
tree | 2682249798fee63636e8bebd668aacad22fae642 | |
parent | 604b858c4f95aedce800a388d9f38e98a2e49216 (diff) | |
parent | 2d19dd86edb3f49440b68b50899c044c983f67ed (diff) | |
download | rabbitmq-codegen-git-16f058decb14318b3dc1e88f6f6487dac38d30de.tar.gz |
More Python 3 compatibility tweaks
Conflicts:
amqp_codegen.py
-rw-r--r-- | amqp_codegen.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/amqp_codegen.py b/amqp_codegen.py index e4de0e0a..6d474e0b 100644 --- a/amqp_codegen.py +++ b/amqp_codegen.py @@ -14,7 +14,7 @@ ## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## -from __future__ import nested_scopes +from __future__ import nested_scopes, print_function import errno import re import sys @@ -30,15 +30,15 @@ try: else: raise e except ImportError: - print >> sys.stderr , " You don't appear to have simplejson.py installed" - print >> sys.stderr , " (an implementation of a JSON reader and writer in Python)." - print >> sys.stderr , " You can install it:" - print >> sys.stderr , " - by running 'apt-get install python-simplejson' on Debian-based systems," - print >> sys.stderr , " - by running 'yum install python-simplejson' on Fedora/Red Hat system," - print >> sys.stderr , " - by running 'port install py25-simplejson' on Macports on OS X" - print >> sys.stderr , " (you may need to say 'make PYTHON=python2.5', as well)," - print >> sys.stderr , " - from sources from 'http://pypi.python.org/pypi/simplejson'" - print >> sys.stderr , " - simplejson is a standard json library in the Python core since 2.6" + print(" You don't appear to have simplejson.py installed", file = sys.stderr) + print(" (an implementation of a JSON reader and writer in Python).", file = sys.stderr) + print(" You can install it:", file = sys.stderr) + print(" - by running 'apt-get install python-simplejson' on Debian-based systems,", file = sys.stderr) + print(" - by running 'yum install python-simplejson' on Fedora/Red Hat system,", file = sys.stderr) + print(" - by running 'port install py25-simplejson' on Macports on OS X", file = sys.stderr) + print(" (you may need to say 'make PYTHON=python2.5', as well),", file = sys.stderr) + print(" - from sources from 'http://pypi.python.org/pypi/simplejson'", file = sys.stderr) + print(" - simplejson is a standard json library in the Python core since 2.6", file = sys.stderr) sys.exit(1) def insert_base_types(d): @@ -236,7 +236,6 @@ class AmqpField(AmqpEntity): self.domain = self.element['type'] else: self.domain = self.element['domain'] - if 'default-value' in self.element: self.defaultvalue = self.element['default-value'] else: @@ -250,9 +249,9 @@ def do_main(header_fn, body_fn): def do_main_dict(funcDict): def usage(): - print >> sys.stderr , "Usage:" - print >> sys.stderr , " %s <function> <path_to_amqp_spec.json>... <path_to_output_file>" % (sys.argv[0]) - print >> sys.stderr , " where <function> is one of %s" % ", ".join([k for k in funcDict.keys()]) + print("Usage:", file = sys.stderr) + print(" {0} <function> <path_to_amqp_spec.json>... <path_to_output_file>".format(sys.argv[0]), file = sys.stderr) + print(" where <function> is one of: {0}".format(", ".join([k for k in funcDict.keys()])), file = sys.stderr) def mkdir_p(path): try: |