From a00729ff7421b3661e8b1a1e0fa46393379f2e96 Mon Sep 17 00:00:00 2001 From: Ben Howard Date: Mon, 8 Feb 2016 16:33:07 -0700 Subject: Import patches-unapplied version 2.1.3-0ubuntu1 to ubuntu/xenial-proposed Imported using git-ubuntu import. Changelog parent: 53f54030cae2de3d5fa474a61fe51f16c7a07c79 New changelog entries: * New upstream release (LP: #1543359): - Bug fixes for extension handling - Feature enablement for AzureStack. --- azurelinuxagent/future.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'azurelinuxagent/future.py') diff --git a/azurelinuxagent/future.py b/azurelinuxagent/future.py index 8451345..8509732 100644 --- a/azurelinuxagent/future.py +++ b/azurelinuxagent/future.py @@ -7,15 +7,25 @@ Add alies for python2 and python3 libs and fucntions. if sys.version_info[0]== 3: import http.client as httpclient from urllib.parse import urlparse - text = str + + """Rename Python3 str to ustr""" + ustr = str + bytebuffer = memoryview + read_input = input + elif sys.version_info[0] == 2: import httplib as httpclient from urlparse import urlparse - text = unicode + + """Rename Python2 unicode to ustr""" + ustr = unicode + bytebuffer = buffer + read_input = raw_input + else: raise ImportError("Unknown python version:{0}".format(sys.version_info)) -- cgit v1.2.3