[tor-commits] [fallback-scripts/master] generate: py3: Update using six.moves
teor at torproject.org
teor at torproject.org
Mon Jan 20 05:32:01 UTC 2020
commit 3830e30575f4b19664cf90c0abbaec1d28f3be77
Author: teor <teor at torproject.org>
Date: Mon Dec 2 14:54:32 2019 +1000
generate: py3: Update using six.moves
Part of 28863.
---
generateFallbackDirLine.py | 5 +++--
requirements.txt | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/generateFallbackDirLine.py b/generateFallbackDirLine.py
index 2177e00..f5e7424 100755
--- a/generateFallbackDirLine.py
+++ b/generateFallbackDirLine.py
@@ -7,7 +7,8 @@
# generateFallbackDirLine.py fingerprint ...
import sys
-import urllib2
+
+from six.moves import urllib
import stem
import stem.descriptor.remote
@@ -32,7 +33,7 @@ for fingerprint in sys.argv[1:]:
try:
desc = stem.descriptor.remote.get_server_descriptors(fingerprint).run()[0]
- except urllib2.HTTPError as exc:
+ except urllib.error.HTTPError as exc:
if exc.code == 404:
print('# %s not found in recent descriptors' % fingerprint)
continue
diff --git a/requirements.txt b/requirements.txt
index 31ee04a..dc71795 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
python-dateutil
+six
stem
More information about the tor-commits
mailing list