X-Git-Url: https://git.mdrn.pl/texml.git/blobdiff_plain/f06bfe769b002b2335a03c7a6c871f2263bef6f6..a25b46f14eae63a90d79da211051eb4f77e620e3:/scripts/texml.py diff --git a/scripts/texml.py b/scripts/texml.py index 40dd6b6..6822dd8 100755 --- a/scripts/texml.py +++ b/scripts/texml.py @@ -24,7 +24,7 @@ use_namespace = 1 import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'hcaw:e:', ['help', 'context', 'ascii', 'width=', 'encoding=', ]) -except getopt.GetoptError, e: +except getopt.GetoptError as e: print >>sys.stderr, 'texml: Can\'t parse command line: %s' % e print >>sys.stderr, usage sys.exit(2) @@ -71,7 +71,7 @@ if '-' == infile: if '-' == outfile: f = sys.stdout else: - f = file(outfile, 'wb') + f = open(outfile, 'wb') # # An error handler @@ -88,7 +88,7 @@ import Texml.processor try: Texml.processor.process(infile, f, encoding, width, always_ascii, use_context) -except Exception, msg: +except Exception as msg: msg = 'texml: %s\n' % (str(msg)) quit(msg)