first pass at removing all python2 specific dependencies, updating python requirements.txt/setup.py/Pipfiles/Makefiles, and removing python2 compat imports
This commit is contained in:
parent
5d5ffb70c2
commit
6edd6a7fdb
13 changed files with 89 additions and 143 deletions
|
@ -5,8 +5,7 @@ event.py: event loop implementation using a heap queue and threads.
|
|||
import heapq
|
||||
import threading
|
||||
import time
|
||||
|
||||
from past.builtins import cmp
|
||||
from functools import total_ordering
|
||||
|
||||
|
||||
class Timer(threading.Thread):
|
||||
|
@ -70,6 +69,7 @@ class Timer(threading.Thread):
|
|||
self.finished.set()
|
||||
|
||||
|
||||
@total_ordering
|
||||
class Event(object):
|
||||
"""
|
||||
Provides event objects that can be used within the EventLoop class.
|
||||
|
@ -92,18 +92,11 @@ class Event(object):
|
|||
self.kwds = kwds
|
||||
self.canceled = False
|
||||
|
||||
def __cmp__(self, other):
|
||||
"""
|
||||
Comparison function.
|
||||
|
||||
:param Event other: event to compare with
|
||||
:return: comparison result
|
||||
:rtype: int
|
||||
"""
|
||||
tmp = cmp(self.time, other.time)
|
||||
if tmp == 0:
|
||||
tmp = cmp(self.eventnum, other.eventnum)
|
||||
return tmp
|
||||
def __lt__(self, other):
|
||||
result = self.time < other.time
|
||||
if result:
|
||||
result = self.eventnum < other.eventnum
|
||||
return result
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue