Skip to content

Commit

Permalink
Don't use \"as\" in except.
Browse files Browse the repository at this point in the history
  • Loading branch information
jedie committed Nov 16, 2011
1 parent 660cac3 commit e8422f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions creole/setup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ def get_long_description(package_root, filename="README.creole", raise_errors=No
long_description_rest = long_description_rest_unicode
else:
long_description_rest = long_description_rest_unicode.encode("utf-8")
except Exception as err:
except Exception:
if raise_errors:
raise
# Don't raise the error e.g. in ./setup install process
evalue = sys.exc_info()[1]
long_description_rest = "[Error: %s]\n%s" % (
err, long_description_origin
evalue, long_description_origin
)
else:
if raise_errors:
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def get_authors():
f = file(os.path.join(PACKAGE_ROOT, "AUTHORS"), "r")
authors = [l.strip(" *\r\n") for l in f if l.strip().startswith("*")]
f.close()
except Exception as err:
authors = "[Error: %s]" % err
except Exception:
evalue = sys.exc_info()[1]
authors = "[Error: %s]" % evalue
return authors


Expand Down

0 comments on commit e8422f9

Please sign in to comment.