[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Replace sys.exc_info() calls
commit 8d2440c859ff58a1250abfbc8ce932c8ee75b04b
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Tue May 8 12:48:48 2018 -0700
Replace sys.exc_info() calls
Huh. Not sure why we did this. Probably overzealous copy-paste.
---
stem/directory.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/stem/directory.py b/stem/directory.py
index e360ead6..cab0f30c 100644
--- a/stem/directory.py
+++ b/stem/directory.py
@@ -40,7 +40,6 @@ as follows...
import os
import re
-import sys
import stem.util.conf
@@ -259,8 +258,7 @@ class Authority(Directory):
def from_remote(timeout = 60):
try:
lines = str_tools._to_unicode(urllib.urlopen(GITWEB_AUTHORITY_URL, timeout = timeout).read()).splitlines()
- except:
- exc = sys.exc_info()[1]
+ except Exception as exc:
raise IOError("Unable to download tor's directory authorities from %s: %s" % (GITWEB_AUTHORITY_URL, exc))
if not lines:
@@ -410,8 +408,7 @@ class Fallback(Directory):
def from_remote(timeout = 60):
try:
lines = str_tools._to_unicode(urllib.urlopen(GITWEB_FALLBACK_URL, timeout = timeout).read()).splitlines()
- except:
- exc = sys.exc_info()[1]
+ except Exception as exc:
raise IOError("Unable to download tor's fallback directories from %s: %s" % (GITWEB_FALLBACK_URL, exc))
if not lines:
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits