Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 8554:92aecf6c5c09
bug: remove exec that re-raises exception for python 2 (hexora)
Eliminate code path for python 2 when handling an unexpected
exception. It exec'ed code to reraise exception.
Python 2 not supported anymore.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 05 Apr 2026 17:49:21 -0400 |
| parents | 9caa03d7e091 |
| children | 98fb176224fc |
comparison
equal
deleted
inserted
replaced
| 8553:ee17f62c8341 | 8554:92aecf6c5c09 |
|---|---|
| 2355 except Exception: | 2355 except Exception: |
| 2356 # Reraise the original exception. The user will | 2356 # Reraise the original exception. The user will |
| 2357 # receive an error message, and the adminstrator will | 2357 # receive an error message, and the adminstrator will |
| 2358 # receive a traceback, albeit with less information | 2358 # receive a traceback, albeit with less information |
| 2359 # than the one we tried to generate above. | 2359 # than the one we tried to generate above. |
| 2360 if sys.version_info[0] > 2: | 2360 raise exc_info[0](exc_info[1]).with_traceback(exc_info[2]) |
| 2361 raise exc_info[0](exc_info[1]).with_traceback(exc_info[2]) | |
| 2362 exec('raise exc_info[0], exc_info[1], exc_info[2]') # nosec | |
| 2363 | 2361 |
| 2364 def renderError(self, error, response_code=400, use_template=True): | 2362 def renderError(self, error, response_code=400, use_template=True): |
| 2365 self.response_code = response_code | 2363 self.response_code = response_code |
| 2366 | 2364 |
| 2367 # see if error message already logged add if not | 2365 # see if error message already logged add if not |
