From f90264d5d53a7b42fd20ecc752c695b971213871 Mon Sep 17 00:00:00 2001 From: Rolf Niepraschk <Rolf.Niepraschk@ptb.de> Date: Tue, 1 Dec 2020 15:00:33 +0100 Subject: [PATCH] ... --- pretty_c14n.py | 12 ++++++------ trans.py | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pretty_c14n.py b/pretty_c14n.py index f986044..d8786c4 100755 --- a/pretty_c14n.py +++ b/pretty_c14n.py @@ -3,14 +3,14 @@ import sys from trans import pretty_c14n -def error_and_exit(x): +def error_exit(x): print('ERROR: ', str(x), file=sys.stderr) sys.exit(1) if len(sys.argv) < 3: - error_and_exit('too few arguments') + error_exit('too few arguments') if sys.argv[1] == sys.argv[2]: - error_and_exit('"infile" and "outfile" must be different') + error_exit('"infile" and "outfile" must be different') infile = sys.argv[1] outfile = sys.argv[2] @@ -21,12 +21,12 @@ try: with open(outfile, 'w') as f2: err, xml = pretty_c14n(xml) if err: - error_and_exit(xml) + error_exit(xml) f2.write(xml) except Exception as error: - error_and_exit(error) + error_exit(error) -print('\nFile »' + infile + '« was successfully canonized to file »' + \ +print('\nFile »' + infile + '« was successfully canonicalized to file »' + \ outfile + '«\n') sys.exit(0) diff --git a/trans.py b/trans.py index d2729ad..594fa19 100644 --- a/trans.py +++ b/trans.py @@ -39,7 +39,6 @@ def cert_to_xml(cert_doc): err, xml = pretty_c14n(xml) if err: xml = '<error>' + xml + '</error>\n' - except Exception as error: xml = '<error>' + str(error) + '</error>\n' -- GitLab