summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/enum.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Lib/enum.py')
-rw-r--r--contrib/tools/python3/Lib/enum.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/tools/python3/Lib/enum.py b/contrib/tools/python3/Lib/enum.py
index 51074404af3..5e7b00654dd 100644
--- a/contrib/tools/python3/Lib/enum.py
+++ b/contrib/tools/python3/Lib/enum.py
@@ -130,7 +130,7 @@ def show_flag_values(value):
def bin(num, max_bits=None):
"""
Like built-in bin(), except negative values are represented in
- twos-compliment, and the leading bit always indicates sign
+ twos-complement, and the leading bit always indicates sign
(0=positive, 1=negative).
>>> bin(10)
@@ -139,6 +139,7 @@ def bin(num, max_bits=None):
'0b1 0101'
"""
+ num = num.__index__()
ceiling = 2 ** (num).bit_length()
if num >= 0:
s = bltns.bin(num + ceiling).replace('1', '0', 1)