Skip to content

Commit 13c1bb2

Browse files
committed
Fixed another isinstance bytes or str for Py2
Also fixed a logging issue
1 parent b187df5 commit 13c1bb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javaobj/v1/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,13 +1394,13 @@ def _convert_type_to_char(self, type_char):
13941394
return type_char.value
13951395
elif type(type_char) is int:
13961396
return type_char
1397-
elif isinstance(type_char, (bytes, str)):
1397+
elif isinstance(type_char, (BYTES_TYPE, UNICODE_TYPE)):
13981398
# Conversion to TypeCode will raise an error if the type
13991399
# is invalid
14001400
return TypeCode(ord(type_char[0])).value
14011401

14021402
raise RuntimeError(
14031403
"Typecode {0} ({1}) isn't supported.".format(
1404-
type_char, ord(type_char)
1404+
type_char, ord(type_char[0])
14051405
)
14061406
)

0 commit comments

Comments
 (0)