From e63ce9197c7bc2edcc1bff5d41e1c1529938f0bc Mon Sep 17 00:00:00 2001 From: dodoru Date: Wed, 25 Oct 2017 13:46:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20urllib.parse=20=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=20py3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/alipay/__init__.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/alipay/__init__.py b/src/alipay/__init__.py index 0200db9..8b71db5 100644 --- a/src/alipay/__init__.py +++ b/src/alipay/__init__.py @@ -9,12 +9,21 @@ import six import requests from pytz import timezone -from six.moves.urllib.parse import ( - parse_qs, - urlparse, - unquote, - urlencode -) + +if six.PY3: + from urllib.parse import ( + parse_qs, + urlparse, + unquote, + urlencode + ) +else: + from six.moves.urllib.parse import ( + parse_qs, + urlparse, + unquote, + urlencode + ) from .exceptions import MissingParameter from .exceptions import ParameterValueError