Bump version (incompatilibity: dropping old Pythons).
[texml.git] / scripts / texml.py
index 40dd6b6..4786233 100755 (executable)
@@ -1,7 +1,7 @@
 #!python
 # $Id: texml.py,v 1.20 2006-07-20 03:56:49 olpa Exp $
 
-VERSION = "2.0.2"; # GREPVERSION # Format of this string is important
+VERSION = "3.0"; # GREPVERSION # Format of this string is important
 usage = """Convert TeXML markup to [La]TeX markup. v.%s. Usage:
 python texml.py [-e encoding] [-w auto_width] [-c|--context] [-a|--ascii] in_file out_file""" % VERSION
 
@@ -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)