Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: third_party/google-endpoints/pyasn1/compat/binary.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/google-endpoints/pyasn1/compat/binary.py
diff --git a/third_party/google-endpoints/pyasn1/compat/binary.py b/third_party/google-endpoints/pyasn1/compat/binary.py
new file mode 100644
index 0000000000000000000000000000000000000000..b38932afd5807151c75701ce8b060c0615a08baa
--- /dev/null
+++ b/third_party/google-endpoints/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
« no previous file with comments | « third_party/google-endpoints/pyasn1/compat/__init__.py ('k') | third_party/google-endpoints/pyasn1/compat/octets.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698