diff options
author | elie <elie> | 2014-02-17 07:09:01 +0000 |
---|---|---|
committer | elie <elie> | 2014-02-17 07:09:01 +0000 |
commit | f65fb2e4dd8ec8558ec16eb30cec1a83a125bf03 (patch) | |
tree | c8b41f8019be05b81bfe7e5c6df233a3962721b3 | |
parent | aa4bf16246bdf8f8cd8c22d52d36a80922670911 (diff) | |
download | pyasn1-f65fb2e4dd8ec8558ec16eb30cec1a83a125bf03.tar.gz |
initial revision
-rw-r--r-- | pyasn1/compat/binary.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyasn1/compat/binary.py b/pyasn1/compat/binary.py new file mode 100644 index 0000000..b38932a --- /dev/null +++ b/pyasn1/compat/binary.py @@ -0,0 +1,10 @@ +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 |