From f78b9650d0e7b008d430673a075aad95dda863be Mon Sep 17 00:00:00 2001 From: Ben Howard Date: Fri, 14 Aug 2015 16:40:41 -0600 Subject: Import patches-unapplied version 2.1.1-0ubuntu1 to ubuntu/wily-proposed Imported using git-ubuntu import. Changelog parent: 0afc048f2a6ff3638ecfa33e7ded5dc8dddf041a New changelog entries: * New upstream release for Ubuntu. - Switch to Python3 - Applies Ubuntu specific patches --- azurelinuxagent/future.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 azurelinuxagent/future.py (limited to 'azurelinuxagent/future.py') diff --git a/azurelinuxagent/future.py b/azurelinuxagent/future.py new file mode 100644 index 0000000..8186fcf --- /dev/null +++ b/azurelinuxagent/future.py @@ -0,0 +1,19 @@ +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 + text = str + bytebuffer = memoryview +elif sys.version_info[0] == 2: + import httplib as httpclient + from urlparse import urlparse + text = unicode + bytebuffer = buffer +else: + raise ImportError("Unknown python version:{0}".format(sys.version_info)) + -- cgit v1.2.3