This isn't completely correct yet. For example:
8 - print "Created:", batch_path 9 - except Exception, e: 10 - print "ERROR: Unable to create %s: %s" % (batch_path, e) 11 + print("Created:", batch_path) 12 + except Exception: 13 + e = sys.exc_info()[1] 14 + print("ERROR: Unable to create %s: %s" % (batch_path, e))
In python2.6 this will print:
('Created:', 'the-batch-path')
You need to you use the %s form:
print("Created: %s" % (batch_path,))
I don't really like that the code is even uglier (setup.py is pretty messy to start with). I'm not really sure the benefit of making it 3.x compatible, given that the rest of the code isn't, but I guess you have to start somewhere.
« Back to merge proposal
This isn't completely correct yet. For example:
8 - print "Created:", batch_path
9 - except Exception, e:
10 - print "ERROR: Unable to create %s: %s" % (batch_path, e)
11 + print("Created:", batch_path)
12 + except Exception:
13 + e = sys.exc_info()[1]
14 + print("ERROR: Unable to create %s: %s" % (batch_path, e))
In python2.6 this will print:
('Created:', 'the-batch-path')
You need to you use the %s form:
print("Created: %s" % (batch_path,))
I don't really like that the code is even uglier (setup.py is pretty messy to start with). I'm not really sure the benefit of making it 3.x compatible, given that the rest of the code isn't, but I guess you have to start somewhere.