mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-09-04 03:07:58 +00:00
Correctly handle absent prefix/suffix in reraise
This commit is contained in:
@@ -34,8 +34,8 @@ class ReraisedException(Exception):
|
|||||||
|
|
||||||
orig = "%s: %s" % (full_class_name(self.old_exc), klass.__str__(self.old_exc))
|
orig = "%s: %s" % (full_class_name(self.old_exc), klass.__str__(self.old_exc))
|
||||||
prefixpart = suffixpart = ''
|
prefixpart = suffixpart = ''
|
||||||
if self.prefix != '':
|
if self.prefix is not None:
|
||||||
prefixpart = self.prefix + "\n"
|
prefixpart = self.prefix + "\n"
|
||||||
if self.suffix != '':
|
if self.suffix is not None:
|
||||||
suffixpart = "\n\n" + self.suffix
|
suffixpart = "\n\n" + self.suffix
|
||||||
return "%sThe original exception was:\n\n%s%s" % (prefixpart, orig, suffixpart)
|
return "%sThe original exception was:\n\n%s%s" % (prefixpart, orig, suffixpart)
|
||||||
|
Reference in New Issue
Block a user