[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #7843 [Stem]: Test and support python 3.x
#7843: Test and support python 3.x
-------------------------+--------------------------------------------------
Reporter: atagar | Owner: atagar
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------+--------------------------------------------------
Comment(by atagar):
> So... um... you mean, run a Py2 script which converts the code base,
including itself, to Py3, then execs Py3 on the newly-converted version of
the running script?
Somehow I get the sense that you're not quite thrilled with this idea. :P
It would largely be the same as the shell script you mentioned. The only
difference is that it lives in test_runner.py, in essence...
{{{
python3_destination = os.path.join(CONFIG["integ.test_directory"],
'python3')
os.makedirs(python3_destination)
system.call("2to3 --write --no-diffs --nobackups --write-unchanged-files
--output-dir=%s stem test run_tests.py" % python3_destination)
system.call("python3 %s/run_tests.py %s" % (python3_destination, "
".join(sys.argv[1:]))
shutil.rmtree(python3_destination, ignore_errors = True)
sys.exit(0) # TODO: use the exit status of the above call instead
}}}
The advantages of this are...
* '--python3' can be a testing argument just like any other.
* No need to have yet another little shell script floating around (fewer
of those mean less clutter, which I like).
Feel free to talk me down from the ledge. ;)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7843#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs