From 5009a9d0f3606fc08a80ec0d59076d8dc48d2f25 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 13 Sep 2016 16:11:47 +0100 Subject: Import patches-unapplied version 2.1.5-0ubuntu1 to ubuntu/yakkety-proposed Imported using git-ubuntu import. Changelog parent: 0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 New changelog entries: * New upstream release (LP: #1603581) - d/patches/disable-auto-update.patch: - The new version introduces auto-updating of the agent to its latest version via an internal mechanism; disable this - d/patches/fix_shebangs.patch: - Dropped in favour of the dh_python3 --shebang option. - Refreshed d/patches/disable_udev_overrides.patch --- azurelinuxagent/common/future.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 azurelinuxagent/common/future.py (limited to 'azurelinuxagent/common/future.py') diff --git a/azurelinuxagent/common/future.py b/azurelinuxagent/common/future.py new file mode 100644 index 0000000..8509732 --- /dev/null +++ b/azurelinuxagent/common/future.py @@ -0,0 +1,31 @@ +import sys + +""" +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 + + """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 + + """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