diff --git a/README.md b/README.md index f83d2f7..bf591d8 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ Evernote for Sublime Text ========================= +[![pc badge]][pc] [![release badge]][release] [![licence badge]][licence] [![stars badge]][repo] [![issues badge]][issues] -[![tips badge]][gratipay] [![paypal badge]][paypal] [![chat badge]][gitter] @@ -324,7 +324,9 @@ Libraries (some adapted to work with Evernote formats): [licence]: [issues]: [repo]: +[pc]: +[pc badge]: https://packagecontrol.herokuapp.com/downloads/Evernote.svg [release badge]: https://img.shields.io/github/release/bordaigorl/sublime-evernote.svg [licence badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat [stars badge]: https://img.shields.io/github/stars/bordaigorl/sublime-evernote.svg diff --git a/lib/thrift/transport/THttpClient.py b/lib/thrift/transport/THttpClient.py index 97e3f5a..bf32ff1 100644 --- a/lib/thrift/transport/THttpClient.py +++ b/lib/thrift/transport/THttpClient.py @@ -21,7 +21,12 @@ import os import socket import sys -import urllib.parse +try: + import urllib.parse + quote = urllib.parse.quote + urlparse = urllib.parse.urlparse +except: + from urllib.parse import quote, urlparse import warnings from io import BytesIO @@ -51,7 +56,7 @@ def __init__(self, uri_or_host, port=None, path=None): self.path = path self.scheme = 'http' else: - parsed = urllib.parse.urlparse(uri_or_host) + parsed = urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': @@ -131,7 +136,7 @@ def flush(self): user_agent = 'Python/THttpClient' script = os.path.basename(sys.argv[0]) if script: - user_agent = '%s (%s)' % (user_agent, urllib.parse.quote(script)) + user_agent = '%s (%s)' % (user_agent, quote(script)) self.__http.putheader('User-Agent', user_agent) if self.__custom_headers: