1. Daniel Miller
  2. sqlalchemy

Commits

Mike Bayer  committed b7d7bfc

got unicode to do None...

  • Participants
  • Parent commits 7f0efc6
  • Branches default

Comments (0)

Files changed (1)

File lib/sqlalchemy/types.py

View file
  • Ignore whitespace
         else:
             return self
     def convert_bind_param(self, value, engine):
-        if not engine.convert_unicode or not isinstance(value, unicode):
+        if not engine.convert_unicode or value is None or not isinstance(value, unicode):
             return value
         else:
             return value.encode('utf-8')
     def convert_result_value(self, value, engine):
-        if not engine.convert_unicode or isinstance(value, unicode):
+        if not engine.convert_unicode or value is None or isinstance(value, unicode):
             return value
         else:
             return value.decode('utf-8')