Opened 6 years ago

Closed 6 years ago

#8565 closed defect (fixed) --python3 fails if python < 2.7 is the default python version

Reported by: Desoxy Owned by: atagar
Priority: Very Low Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


desoxy@localhost:~/git/stem$ python --version
Python 2.6.6
desoxy@localhost:~/git/stem$ python --python3
Traceback (most recent call last):
  File "", 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.


Child Tickets

Attachments (1)

python26-2to3-test-patch.patch (567 bytes) - added by Desoxy 6 years ago.

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by Desoxy

comment:1 Changed 6 years ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.