Re-implemented the six.with_metaclass functionality to avoid having to include six in the distrubution.
This commit is contained in:
parent
d0edb84909
commit
29cde0921d
1 changed files with 6 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ Modified for Evennia by Griatch.
|
|||
from copy import deepcopy
|
||||
from base64 import b64encode, b64decode
|
||||
from zlib import compress, decompress
|
||||
#import six # not in default syslib
|
||||
import django
|
||||
from django.db import models
|
||||
|
||||
|
|
@ -112,7 +113,11 @@ def _get_subfield_superclass():
|
|||
# see https://github.com/django/django/commit/222c73261650201f5ce99e8dd4b1ce0d30a69eb4
|
||||
if django.VERSION < (1,3):
|
||||
return models.Field
|
||||
return six.with_metaclass(models.SubfieldBase, models.Field)
|
||||
# mimic six.with_metaclass
|
||||
meta = models.SubfieldBase
|
||||
base = models.Field
|
||||
return meta("NewBase", (base,), {})
|
||||
#return six.with_metaclass(models.SubfieldBase, models.Field)
|
||||
|
||||
|
||||
class PickledObjectField(_get_subfield_superclass()):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue