diff options
author | Erik Johnston <erik@matrix.org> | 2018-10-26 16:22:45 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-10-26 16:22:45 +0100 |
commit | 03e634dad4cd1014f609ece9574df7a24f1ec254 (patch) | |
tree | a9f4a53a03bb0205e616ce7cf741fdbd15d4fcf5 /scripts-dev/dump_macaroon.py | |
parent | pep8 (diff) | |
parent | Port register_new_matrix_user to Python 3 and add tests (#4085) (diff) | |
download | synapse-03e634dad4cd1014f609ece9574df7a24f1ec254.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/purge_state_groups
Diffstat (limited to 'scripts-dev/dump_macaroon.py')
-rwxr-xr-x | scripts-dev/dump_macaroon.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts-dev/dump_macaroon.py b/scripts-dev/dump_macaroon.py index fcc5568835..22b30fa78e 100755 --- a/scripts-dev/dump_macaroon.py +++ b/scripts-dev/dump_macaroon.py @@ -1,8 +1,11 @@ #!/usr/bin/env python2 -import pymacaroons +from __future__ import print_function + import sys +import pymacaroons + if len(sys.argv) == 1: sys.stderr.write("usage: %s macaroon [key]\n" % (sys.argv[0],)) sys.exit(1) @@ -11,14 +14,14 @@ macaroon_string = sys.argv[1] key = sys.argv[2] if len(sys.argv) > 2 else None macaroon = pymacaroons.Macaroon.deserialize(macaroon_string) -print macaroon.inspect() +print(macaroon.inspect()) -print "" +print("") verifier = pymacaroons.Verifier() verifier.satisfy_general(lambda c: True) try: verifier.verify(macaroon, key) - print "Signature is correct" + print("Signature is correct") except Exception as e: - print str(e) + print(str(e)) |