diff options
author | Mike Crute <mike@crute.us> | 2017-10-30 02:22:31 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2017-10-30 02:28:14 +0000 |
commit | 2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1 (patch) | |
tree | 588c80051a3c7dbfe4839e78a08f86fd7b77971e | |
parent | 1b20d353dabb63f2c68ee7f5563b5d3f22833a17 (diff) | |
download | pydora-2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1.tar.bz2 pydora-2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1.tar.xz pydora-2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1.zip |
Move with_metaclass to py2compat
This is an internal implementation detail that exists purely for python2
backwards compatibility. Put it with all the other python 2
compatibility stuff.
-rw-r--r-- | pandora/models/__init__.py | 5 | ||||
-rw-r--r-- | pandora/py2compat.py | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/pandora/models/__init__.py b/pandora/models/__init__.py index f799308..5b25de2 100644 --- a/pandora/models/__init__.py +++ b/pandora/models/__init__.py | |||
@@ -1,9 +1,6 @@ | |||
1 | from datetime import datetime | 1 | from datetime import datetime |
2 | from collections import namedtuple | 2 | from collections import namedtuple |
3 | 3 | from ..py2compat import with_metaclass | |
4 | |||
5 | def with_metaclass(meta, *bases): | ||
6 | return meta("NewBase", bases, {}) | ||
7 | 4 | ||
8 | 5 | ||
9 | class Field(namedtuple("Field", ["field", "default", "formatter"])): | 6 | class Field(namedtuple("Field", ["field", "default", "formatter"])): |
diff --git a/pandora/py2compat.py b/pandora/py2compat.py index b8767ba..dfd9abd 100644 --- a/pandora/py2compat.py +++ b/pandora/py2compat.py | |||
@@ -7,6 +7,11 @@ patch Python 2 code to support those changes. When Python 2 support is | |||
7 | dropped this module can be removed and imports can be updated. | 7 | dropped this module can be removed and imports can be updated. |
8 | """ | 8 | """ |
9 | 9 | ||
10 | |||
11 | def with_metaclass(meta, *bases): | ||
12 | return meta("NewBase", bases, {}) | ||
13 | |||
14 | |||
10 | try: | 15 | try: |
11 | from configparser import ConfigParser | 16 | from configparser import ConfigParser |
12 | except ImportError: | 17 | except ImportError: |