Allow changes to run under Python 3
This commit is contained in:
parent
97b3656c2e
commit
48ea9cea77
3 changed files with 28 additions and 12 deletions
|
@ -708,3 +708,13 @@ class DateRange(object):
|
|||
return self.start <= date <= self.end
|
||||
def __str__(self):
|
||||
return '%s - %s' % ( self.start.isoformat(), self.end.isoformat())
|
||||
|
||||
|
||||
def bytes_to_intlist(bs):
|
||||
if not bs:
|
||||
return []
|
||||
if isinstance(bs[0], int): # Python 3
|
||||
return list(bs)
|
||||
else:
|
||||
return [ord(c) for c in bs]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue