[tor-commits] [stem/master] Replace sys.exc_info() calls

atagar at torproject.org atagar at torproject.org
Tue May 8 20:20:10 UTC 2018


commit 8d2440c859ff58a1250abfbc8ce932c8ee75b04b
Author: Damian Johnson <atagar at torproject.org>
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:





More information about the tor-commits mailing list