Re: [PATCH] Error out with proper error message when using Python >= 3.0 (was: building SVN trunk on Windows fails on python gen-make.py)
From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 22 Jul 2015 11:31:31 +0000
Stefan Hett wrote on Mon, Jul 20, 2015 at 16:59:08 +0200:
The 'except' comma syntax is supported by Python through 2.7 (inclusive)
So, I think we should:
- For 1.7/1.8, if we expect people will try to build them with py3,
- For trunk, I think we should convert to the 'except' 'as' syntax and
- For 1.9, it's a little late to make any changes, but I would consider
Thoughts?
Daniel
-- References: [py2.5 'except' syntax] https://docs.python.org/2.5/ref/try.html [py2.6 'except' syntax] https://docs.python.org/2.6/reference/compound_stmts.html#the-try-statement [py2.6 EOL] https://www.python.org/dev/peps/pep-0361/ > So I guess it might be worthwhile adding some check there too? > > [[[ > Detect Python >= 3.0 and error out in gen-make.py (rather than > producing some cryptic error/callstack). > > * gen-make.py > (): Add python version check >= 3.0 and error out. > ]]] > > Regards, > Stefan > Index: gen-make.py > =================================================================== > --- gen-make.py (revision 1691913) > +++ gen-make.py (working copy) > @@ -28,6 +28,10 @@ > import traceback > import sys > > +if sys.hexversion >= 0x03000000: > + print("Python >= 3.0 not supported. Please use Python >= 2.5 and < 3.0") > + sys.exit(2) > + > import getopt > try: > my_getopt = getopt.gnu_getoptReceived on 2015-07-22 13:31:49 CEST |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.