You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
411 B
19 lines
411 B
import sys
|
|
|
|
|
|
class UnicodeMixin(object):
|
|
|
|
"""Mixin class to handle defining the proper __str__/__unicode__
|
|
methods in Python 2 or 3."""
|
|
|
|
if sys.version_info[0] >= 3: # Python 3
|
|
def __str__(self):
|
|
return self.__unicode__()
|
|
else: # Python 2
|
|
def __str__(self):
|
|
return self.__unicode__().encode('utf8')
|
|
|
|
|
|
class PropertyUnavailable(AttributeError):
|
|
pass
|