Skip to content

Commit b5789ea

Browse files
authored
Merge pull request package-url#3 from jpopelka/python3
Fix imports to support Python 3 Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
2 parents 436f90d + 66910f5 commit b5789ea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/packageurl.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@
2727

2828
from collections import namedtuple
2929

30-
from urllib import quote as percent_quote
31-
from urllib import unquote as percent_unquote
32-
3330
# Python 2 and 3 support
3431
try:
32+
# Python 2
3533
from urlparse import urlsplit
34+
from urllib import quote as percent_quote
35+
from urllib import unquote as percent_unquote
3636
except ImportError:
37+
# Python 3
3738
from urllib.parse import urlsplit
39+
from urllib.parse import quote as percent_quote
40+
from urllib.parse import unquote as percent_unquote
3841

3942
# Python 2 and 3 support
4043
try:

0 commit comments

Comments
 (0)