mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-24 23:43:00 +00:00
Disable Python 3's exception chaining when reraising
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
|
||||
# We keep the actual reraising in different modules since the
|
||||
# Python 2 version SyntaxError's in Python 3.
|
||||
# We keep the actual reraising in different modules, since the
|
||||
# reraising code uses syntax mutually exclusive to Python 2/3.
|
||||
if sys.version_info[0] < 3:
|
||||
from .reraise_impl_py2 import reraise_impl
|
||||
else:
|
||||
|
@@ -1,2 +1,4 @@
|
||||
# http://stackoverflow.com/a/33822606 -- `from None` disables Python 3'
|
||||
# semi-smart exception chaining, which we don't want in this case.
|
||||
def reraise_impl(e, traceback):
|
||||
raise e.with_traceback(traceback)
|
||||
raise e.with_traceback(traceback) from None
|
||||
|
Reference in New Issue
Block a user