| @@ -1,22 +1,24 @@ | | | @@ -1,22 +1,24 @@ |
1 | $NetBSD: patch-zanataclient_zanatalib_rest_client.py,v 1.1 2016/03/05 04:47:44 ryoon Exp $ | | 1 | $NetBSD: patch-zanataclient_zanatalib_rest_client.py,v 1.2 2016/03/05 04:48:36 ryoon Exp $ |
| | | 2 | |
| | | 3 | * Fix zanata push |
2 | | | 4 | |
3 | --- zanataclient/zanatalib/rest/client.py.orig 2016-01-20 23:38:42.000000000 +0000 | | 5 | --- zanataclient/zanatalib/rest/client.py.orig 2016-01-20 23:38:42.000000000 +0000 |
4 | +++ zanataclient/zanatalib/rest/client.py | | 6 | +++ zanataclient/zanatalib/rest/client.py |
5 | @@ -29,7 +29,7 @@ except ImportError: | | 7 | @@ -29,7 +29,7 @@ except ImportError: |
6 | from urlparse import urlparse | | 8 | from urlparse import urlparse |
7 | import sys | | 9 | import sys |
8 | import warnings | | 10 | import warnings |
9 | -from io import StringIO | | 11 | -from io import StringIO |
10 | +import StringIO | | 12 | +import StringIO |
11 | warnings.simplefilter("ignore", DeprecationWarning) | | 13 | warnings.simplefilter("ignore", DeprecationWarning) |
12 | import httplib2 | | 14 | import httplib2 |
13 | | | 15 | |
14 | @@ -54,7 +54,7 @@ class RestClient(object): | | 16 | @@ -54,7 +54,7 @@ class RestClient(object): |
15 | if body is not None: | | 17 | if body is not None: |
16 | thelen = str(len(body)) | | 18 | thelen = str(len(body)) |
17 | headers['Content-Length'] = thelen | | 19 | headers['Content-Length'] = thelen |
18 | - body = StringIO(body) | | 20 | - body = StringIO(body) |
19 | + body = StringIO.StringIO(body) | | 21 | + body = StringIO.StringIO(body) |
20 | | | 22 | |
21 | try: | | 23 | try: |
22 | response, content = self.http_client.request(resource, method.upper(), body, headers=headers) | | 24 | response, content = self.http_client.request(resource, method.upper(), body, headers=headers) |