summaryrefslogtreecommitdiff
path: root/autoimport.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2020-02-16 08:21:20 +0100
committerHelmut Grohne <helmut@subdivi.de>2020-02-16 08:21:20 +0100
commit27b95909f061ae3ecb3ba1b8d46adfef98ca5e6f (patch)
tree87695b998b1e97e406050584812d4db68bdb4610 /autoimport.py
parente77a1ebf8bda10494088bb6c72873d8ef214e0f3 (diff)
downloaddebian-dedup-27b95909f061ae3ecb3ba1b8d46adfef98ca5e6f.tar.gz
drop support for Python 2.x
Diffstat (limited to 'autoimport.py')
-rwxr-xr-xautoimport.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/autoimport.py b/autoimport.py
index e51d052..ec47db0 100755
--- a/autoimport.py
+++ b/autoimport.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""This scrip takes a directory or a http base url to a mirror and imports all
packages contained. It has rather strong assumptions on the working directory.
"""
@@ -12,11 +12,7 @@ import sqlite3
import subprocess
import sys
import tempfile
-try:
- from urllib.parse import unquote
-except ImportError:
- from urllib import unquote
-
+import urllib.parse
import concurrent.futures
from debian import deb822
from debian.debian_support import version_compare
@@ -47,7 +43,7 @@ def process_file(pkgs, filename):
if len(parts) != 3:
raise ValueError("filename not in form name_version_arch.deb")
name, version, _ = parts
- version = unquote(version)
+ version = urllib.parse.unquote(version)
if name in pkgs and version_compare(pkgs[name]["version"], version) > 0:
return
pkgs[name] = dict(version=version, filename=filename)