diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-10 09:39:21 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-10 09:39:21 +0100 |
commit | ac3ba239c54965e464e6047fd872f02ca1c0cb99 (patch) | |
tree | 34caf2b39ab801fe2cd7d6ce5280c75fe6f47ec5 /setuptools/compat.py | |
parent | fb8c7cf0abc9ce58b8a6f0621c0a9909fb9b8eff (diff) | |
download | external_python_setuptools-ac3ba239c54965e464e6047fd872f02ca1c0cb99.tar.gz external_python_setuptools-ac3ba239c54965e464e6047fd872f02ca1c0cb99.tar.bz2 external_python_setuptools-ac3ba239c54965e464e6047fd872f02ca1c0cb99.zip |
Post-merge fixes for Python 3.
--HG--
branch : distribute
extra : source : 6b9041dea7b9197f6ea1fb993d7a05dd4f7c580d
Diffstat (limited to 'setuptools/compat.py')
-rw-r--r-- | setuptools/compat.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/setuptools/compat.py b/setuptools/compat.py index c5d28be5..6d4ea539 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -41,6 +41,8 @@ if sys.version_info[0] < 3: locs = globs exec("""exec code in globs, locs""") + exec_("""def reraise(tp, value, tb=None): + raise tp, value, tb""") else: PY3 = True @@ -76,3 +78,8 @@ else: locs = globs exec_(compile(open(fn).read(), fn, 'exec'), globs, locs) + def reraise(tp, value, tb=None): + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + |