Skip to content

Commit 4726797

Browse files
committed
PYTHON-3679 Fix bson/decimal128.py:103: error: Unsupported operand types for + ("Literal['n']"
1 parent 782614a commit 4726797

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bson/decimal128.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import decimal
2121
import struct
22-
from typing import Any, Sequence, Tuple, Type, Union
22+
from typing import Any, Sequence, Tuple, Type, Union, cast
2323

2424
_PACK_64 = struct.Struct("<Q").pack
2525
_UNPACK_64 = struct.Struct("<Q").unpack
@@ -100,7 +100,7 @@ def _decimal_to_128(value: _VALUE_OPTIONS) -> Tuple[int, int]:
100100
if significand & (1 << i):
101101
high |= 1 << (i - 64)
102102

103-
biased_exponent = exponent + _EXPONENT_BIAS
103+
biased_exponent = cast(int, exponent) + _EXPONENT_BIAS
104104

105105
if high >> 49 == 1:
106106
high = high & 0x7FFFFFFFFFFF

0 commit comments

Comments
 (0)