[tor-bugs] #8565 [Stem]: run_tests.py --python3 fails if python < 2.7 is the default python version
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Mar 22 09:14:39 UTC 2013
#8565: run_tests.py --python3 fails if python < 2.7 is the default python version
---------------------+------------------------------------------------------
Reporter: Desoxy | Owner: atagar
Type: defect | Status: new
Priority: trivial | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
---------------------+------------------------------------------------------
{{{
desoxy at localhost:~/git/stem$ python --version
Python 2.6.6
desoxy at localhost:~/git/stem$ python run_tests.py --python3
Traceback (most recent call last):
File "run_tests.py", line 428, in <module>
if CONFIG["argument.python3"] and sys.version_info.major != 3:
AttributeError: 'tuple' object has no attribute 'major'
}}}
The reason is simple: sys.version_info only became a named tuple in Python
v2.7 and later.[1]
Assuming you want to keep compability with older Python versions, the
attached one-line patch fixes this problem.
1:
http://docs.python.org/2/library/sys.html?highlight=sys#sys.version_info))
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8565>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list