From 05e9c5f67ecf1efb9e90b145e9e1038ce77e5514 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 5 Jan 1999 23:05:58 +0000 Subject: 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. --- Mailman/pythonlib/tempfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Mailman/pythonlib/tempfile.py') 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) -- cgit v1.2.3-70-g09d2