Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ObjectId.__str__ should return str in 2.x.

This addresses the issue raised in pull request
155.
  • Loading branch information...
commit c8f6d4aa0310e894adf6ad43c320a0fa03a0abfb 1 parent 890fc92
@behackett behackett authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 bson/objectid.py
View
4 bson/objectid.py
@@ -244,7 +244,9 @@ def __setstate__(self, value):
self.__id = oid
def __str__(self):
- return binascii.hexlify(self.__id).decode()
+ if PY3:
+ return binascii.hexlify(self.__id).decode()
+ return binascii.hexlify(self.__id)
def __repr__(self):
return "ObjectId('%s')" % (str(self),)
Please sign in to comment.
Something went wrong with that request. Please try again.