Skip to content

Commit a87a564

Browse files
cool-RRsybrenstuvel
authored andcommitted
Fix exception cause in common.py
1 parent ec57ac0 commit a87a564

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rsa/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def bit_size(num: int) -> int:
4949

5050
try:
5151
return num.bit_length()
52-
except AttributeError:
53-
raise TypeError('bit_size(num) only supports integers, not %r' % type(num))
52+
except AttributeError as ex:
53+
raise TypeError('bit_size(num) only supports integers, not %r' % type(num)) from ex
5454

5555

5656
def byte_size(number: int) -> int:

0 commit comments

Comments
 (0)