You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/02/21 03:52:30 UTC
svn commit: r1448494 - in /libcloud/branches/0.12.x: ./ libcloud/utils/py3.py
Author: tomaz
Date: Thu Feb 21 02:52:30 2013
New Revision: 1448494
URL: http://svn.apache.org/r1448494
Log:
Backport commit from trunk.
Modified:
libcloud/branches/0.12.x/ (props changed)
libcloud/branches/0.12.x/libcloud/utils/py3.py
Propchange: libcloud/branches/0.12.x/
------------------------------------------------------------------------------
Merged /libcloud/trunk:r1448492
Modified: libcloud/branches/0.12.x/libcloud/utils/py3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/utils/py3.py?rev=1448494&r1=1448493&r2=1448494&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/utils/py3.py (original)
+++ libcloud/branches/0.12.x/libcloud/utils/py3.py Thu Feb 21 02:52:30 2013
@@ -48,17 +48,22 @@ if PY3:
import urllib as urllib2
import urllib.parse as urlparse
import xmlrpc.client as xmlrpclib
+
from urllib.parse import quote as urlquote
from urllib.parse import unquote as urlunquote
from urllib.parse import urlencode as urlencode
from os.path import relpath
+ from imp import reload
+
+ from builtins import bytes
+ from builtins import next
+
basestring = str
def method_type(callable, instance, klass):
return types.MethodType(callable, instance or klass())
- bytes = __builtins__['bytes']
def b(s):
if isinstance(s, str):
return s.encode('utf-8')
@@ -70,7 +75,7 @@ if PY3:
# assume n is a Latin-1 string of length 1
return ord(n)
u = str
- next = __builtins__['next']
+
def dictvalues(d):
return list(d.values())
@@ -87,6 +92,8 @@ else:
from urllib import unquote as urlunquote
from urllib import urlencode as urlencode
+ from __builtin__ import reload
+
if not PY25:
from os.path import relpath
@@ -122,8 +129,3 @@ if PY25:
if not rel_list:
return posixpath.curdir
return posixpath.join(*rel_list)
-
-if PY32:
- from imp import reload
-else:
- from __builtin__ import reload