Skip to content

Commit 5da065a

Browse files
committed
fixed py3 bug
1 parent 905cf76 commit 5da065a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

v3/pg_encoder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def is_class(dat):
8282
def is_instance(dat):
8383
"""Return whether dat is an instance of a class."""
8484
if is_python3:
85-
return isinstance(type(dat), type) and not isinstance(dat, type)
85+
return type(dat) not in PRIMITIVE_TYPES and \
86+
isinstance(type(dat), type) and \
87+
not isinstance(dat, type)
8688
else:
8789
# ugh, classRE match is a bit of a hack :(
8890
return type(dat) == types.InstanceType or classRE.match(str(type(dat)))

0 commit comments

Comments
 (0)