File: pep237.py

package info (click to toggle)
pwntools 4.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 18,436 kB
  • sloc: python: 59,156; ansic: 48,063; asm: 45,030; sh: 396; makefile: 256
file content (18 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# Override the behavior of the built-in hex() method
# to strip the trailing 'L'.
#
# This has no meaning anymore, as of 2006.
#
# https://www.python.org/dev/peps/pep-0237/
# https://mail.python.org/pipermail/python-dev/2006-June/065918.html
#
from six.moves import builtins

original_hex = builtins.hex

def hex(number):
    original_hex.__doc__
    return original_hex(number).rstrip('L')

builtins.hex = hex