Make `byte_ord` gentler
This commit is contained in:
parent
c646e72832
commit
85e9405f8a
|
@ -113,7 +113,9 @@ else:
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def byte_ord(c):
|
def byte_ord(c):
|
||||||
assert isinstance(c, int)
|
# In case we're handed a string instead of an int.
|
||||||
|
if not isinstance(c, int):
|
||||||
|
c = ord(c)
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def byte_chr(c):
|
def byte_chr(c):
|
||||||
|
|
Loading…
Reference in New Issue