Title: 2to3 not handing "<="
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, xxm
Priority: normal Keywords:

Created on 2019-08-03 14:23 by xxm, last changed 2019-08-03 15:12 by eric.smith. This issue is now closed.

File name Uploaded Description Edit xxm, 2019-08-03 14:23 This Python2 project lies on Github After conversion of 2to3 and fixing tab problem in Python3 code, we make "" run in Python3 environment. It report the Error..
Messages (2)
msg348961 - (view) Author: Xinmeng Xia (xxm) Date: 2019-08-03 14:23
After conversion of 2to3 , run and the following error will happen.
Traceback (most recent call last):
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/", line 15, in <module>
    plays = nflgame.combine_plays(games)
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/nflgame/", line 396, in combine_plays
    chain = itertools.chain(*[g.drives.plays() for g in games])
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/nflgame/", line 396, in <listcomp>
    chain = itertools.chain(*[g.drives.plays() for g in games])
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/nflgame/", line 407, in __getattr__
    self.__drives = _json_drives(self, self.home,['drives'])
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/nflgame/", line 675, in _json_drives
    d = Drive(game, i, home_team, data[str(drive_num)])
  File "/home/xxm/Desktop/instrument/datasetpy3/nflgame/nflgame/", line 516, in __init__
    if self.time_end <= self.time_start \
TypeError: '<=' not supported between instances of 'GameClock' and 'GameClock'
msg348963 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-08-03 15:12
2to3 is not designed to turn every valid python2 program into a valid python3 program. You'll have to provide a way to compare GameClock objects. I suggest you look at You should read the whole site, it's a great resource. Specifically in this case, see
Date User Action Args
2019-08-03 15:12:36eric.smithsetstatus: open -> closed

type: compile error -> behavior

nosy: + eric.smith
messages: + msg348963
resolution: not a bug
stage: resolved
2019-08-03 14:23:18xxmcreate