unquote moved from urllib to urllib.parse in py3k
authorHelmut Grohne <helmut@subdivi.de>
Thu, 16 Apr 2015 15:56:02 +0000 (17:56 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Thu, 16 Apr 2015 15:56:02 +0000 (17:56 +0200)
autoimport.py

index 9c4c73e..3076f6e 100755 (executable)
@@ -13,6 +13,10 @@ import sqlite3
 import subprocess
 import tempfile
 import urllib
+try:
+    from urllib.parse import unquote
+except ImportError:
+    from urllib import unquote
 
 import concurrent.futures
 from debian import deb822
@@ -42,7 +46,7 @@ def process_file(pkgs, filename):
     if len(parts) != 3:
         raise ValueError("filename not in form name_version_arch.deb")
     name, version, _ = parts
-    version = urllib.unquote(version)
+    version = unquote(version)
     if name in pkgs and version_compare(pkgs[name]["version"], version) > 0:
         return
     pkgs[name] = dict(version=version, filename=filename)