diff options
| author | bwarsaw | 1999-01-05 23:05:58 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-01-05 23:05:58 +0000 |
| commit | 05e9c5f67ecf1efb9e90b145e9e1038ce77e5514 (patch) | |
| tree | 7eeeab5b28b4ca7b64120694267b52bb907a7292 /Mailman/pythonlib/tempfile.py | |
| parent | 1e92ae2a26b738908056eda3cc5d6ed7f9dfe25e (diff) | |
| download | mailman-05e9c5f67ecf1efb9e90b145e9e1038ce77e5514.tar.gz mailman-05e9c5f67ecf1efb9e90b145e9e1038ce77e5514.tar.zst mailman-05e9c5f67ecf1efb9e90b145e9e1038ce77e5514.zip | |
TemporaryFile(): Divergence from Python 1.5.2 version. Can't use bare
`raise' here since we may be running under Python 1.5. I don't use
Utils.reraise() because I don't want to import Utils, so just do the
manual sys import and raise.
Diffstat (limited to 'Mailman/pythonlib/tempfile.py')
| -rw-r--r-- | Mailman/pythonlib/tempfile.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Mailman/pythonlib/tempfile.py b/Mailman/pythonlib/tempfile.py index 1f301262d..7c59eb6a5 100644 --- a/Mailman/pythonlib/tempfile.py +++ b/Mailman/pythonlib/tempfile.py @@ -134,7 +134,12 @@ def TemporaryFile(mode='w+b', bufsize=-1, suffix=""): return os.fdopen(fd, mode, bufsize) except: os.close(fd) - raise + # this is a divergence from the Python 1.5.2 copy. Mailman can't + # guarantee that Python 1.5.1 or better is being used, and Python + # 1.5 doesn't have bare raise. + import sys + t, v, tb = sys.exc_info() + raise t, v, tb else: # Non-unix -- can't unlink file that's still open, use wrapper file = open(name, mode, bufsize) |
