libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209974 - /libcloud/branches/py3k/libcloud/py3.py
Date Sat, 03 Dec 2011 18:42:39 GMT
Author: tomaz
Date: Sat Dec  3 18:42:39 2011
New Revision: 1209974

URL: http://svn.apache.org/viewvc?rev=1209974&view=rev
Log:
Update py3.py.

Modified:
    libcloud/branches/py3k/libcloud/py3.py

Modified: libcloud/branches/py3k/libcloud/py3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/py3.py?rev=1209974&r1=1209973&r2=1209974&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/py3.py (original)
+++ libcloud/branches/py3k/libcloud/py3.py Sat Dec  3 18:42:39 2011
@@ -14,6 +14,9 @@
 # limitations under the License.
 
 # Libcloud Python 2.x and 3.x compatibility layer
+# Some methods bellow are taken from Django PYK3 port which is licensed under 3
+# clause BSD license
+# https://bitbucket.org/loewis/django-3k
 
 from __future__ import absolute_import
 
@@ -21,6 +24,7 @@ import sys
 import types
 
 PY3 = False
+PY2 = False
 PY25 = False
 
 if sys.version_info >= (3, 0):
@@ -39,7 +43,6 @@ if sys.version_info >= (3, 0):
     def method_type(callable, instance, klass):
         return types.MethodType(callable, instance or klass())
 
-    # Taken from django.utils.py3
     bytes = __builtins__['bytes']
     def b(s):
         if isinstance(s, str):
@@ -56,6 +59,7 @@ if sys.version_info >= (3, 0):
     def dictvalues(d):
         return list(d.values())
 else:
+    PY2 = True
     import httplib
     from StringIO import StringIO
     import urllib
@@ -69,7 +73,6 @@ else:
 
     method_type = types.MethodType
 
-    # Taken from django.utils.py3
     b = bytes = str
     def byte(n):
         return n



Mime
View raw message