Skip to content
This repository
Browse code

Don't use \"as\" in except.

  • Loading branch information...
commit e8422f944709a5f8c2c6a8c8a58a84a92620f035 1 parent 660cac3
Jens Diemer authored November 16, 2011
5  creole/setup_utils.py
@@ -105,12 +105,13 @@ def get_long_description(package_root, filename="README.creole", raise_errors=No
105 105
             long_description_rest = long_description_rest_unicode
106 106
         else:
107 107
             long_description_rest = long_description_rest_unicode.encode("utf-8")
108  
-    except Exception as err:
  108
+    except Exception:
109 109
         if raise_errors:
110 110
             raise
111 111
         # Don't raise the error e.g. in ./setup install process
  112
+        evalue = sys.exc_info()[1]
112 113
         long_description_rest = "[Error: %s]\n%s" % (
113  
-            err, long_description_origin
  114
+            evalue, long_description_origin
114 115
         )
115 116
     else:
116 117
         if raise_errors:
5  setup.py
@@ -27,8 +27,9 @@ def get_authors():
27 27
         f = file(os.path.join(PACKAGE_ROOT, "AUTHORS"), "r")
28 28
         authors = [l.strip(" *\r\n") for l in f if l.strip().startswith("*")]
29 29
         f.close()
30  
-    except Exception as err:
31  
-        authors = "[Error: %s]" % err
  30
+    except Exception:
  31
+        evalue = sys.exc_info()[1]
  32
+        authors = "[Error: %s]" % evalue
32 33
     return authors
33 34
 
34 35
 

0 notes on commit e8422f9

Please sign in to comment.
Something went wrong with that request. Please try again.