From: Daniele Varrazzo Date: Sun, 16 May 2021 00:24:50 +0000 (+0200) Subject: Don't chain exceptions raising in decimal binary loading X-Git-Tag: 3.0.dev0~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be5346757bc6eeb8bb29834a31eb68ebaf7f98cd;p=thirdparty%2Fpsycopg.git Don't chain exceptions raising in decimal binary loading --- diff --git a/psycopg3/psycopg3/types/numeric.py b/psycopg3/psycopg3/types/numeric.py index 0108e95aa..d1dca439f 100644 --- a/psycopg3/psycopg3/types/numeric.py +++ b/psycopg3/psycopg3/types/numeric.py @@ -369,7 +369,9 @@ class NumericBinaryLoader(Loader): try: return _decimal_special[sign] except KeyError: - raise e.DataError(f"bad value for numeric sign: 0x{sign:X}") + raise e.DataError( + f"bad value for numeric sign: 0x{sign:X}" + ) from None NUMERIC_NAN_BIN = _pack_numeric_head(0, 0, NUMERIC_NAN, 0)