bin: Fixed boolean encoding bug.
[coe.git] / coe / bin.py
index e965a79..b9ee601 100644 (file)
@@ -89,9 +89,9 @@ class encoder(object):
             return
         if datum == None:
             self.writetag(dst, T_NIL, 0, None)
-        elif datum == False:
+        elif datum is False:
             self.writetag(dst, T_NIL, NIL_FALSE, None)
-        elif datum == True:
+        elif datum is True:
             self.writetag(dst, T_NIL, NIL_TRUE, None)
         elif isinstance(datum, int):
             self.writetag(dst, T_INT, 0, None)
@@ -292,4 +292,4 @@ class decoder(object):
         return self.loadtagged(fp, tag)
 
 def load(fp):
-    decoder().load(fp)
+    return decoder().load(fp)