Skip to content

Commit

Permalink
bugfix: compressLongInt: was not working in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Mar 18, 2021
1 parent 9ac247f commit 1389d7d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scal3/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ def mylocaltime(sec=None, mode=None):

def compressLongInt(num):
from struct import pack
return pack('L', num % 2**64).\
rstrip('\x00').\
encode('base64')[:-3].\
replace('/', '_')
from base64 import b64encode
return b64encode(
pack('L', num % 2**64).rstrip(b'\x00')
)[:-3].decode('ascii').replace('/', '_')

getCompactTime = lambda maxDays=1000, minSec=0.1:\
compressLongInt(
Expand Down

0 comments on commit 1389d7d

Please sign in to comment.