Handle bytearrays in python 3.1
(self, instance, value)
| 1563 | super().__init__(**kwargs) |
| 1564 | |
| 1565 | def __set__(self, instance, value): |
| 1566 | """Handle bytearrays in python 3.1""" |
| 1567 | if isinstance(value, bytearray): |
| 1568 | value = bytes(value) |
| 1569 | return super().__set__(instance, value) |
| 1570 | |
| 1571 | def to_mongo(self, value): |
| 1572 | return Binary(value) |