openmedialibrary_platform_w.../Lib/site-packages/pyasn1/compat/binary.py

11 lines
201 B
Python
Raw Normal View History

2016-01-31 14:44:46 +00:00
from sys import version_info
if version_info[0:2] < (2, 6):
def bin(x):
if x <= 1:
return '0b'+str(x)
else:
return bin(x>>1) + str(x&1)
else:
bin = bin