aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2017-10-30 02:22:31 +0000
committerMike Crute <mike@crute.us>2017-10-30 02:28:14 +0000
commit2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1 (patch)
tree588c80051a3c7dbfe4839e78a08f86fd7b77971e
parent1b20d353dabb63f2c68ee7f5563b5d3f22833a17 (diff)
downloadpydora-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__.py5
-rw-r--r--pandora/py2compat.py5
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 @@
1from datetime import datetime 1from datetime import datetime
2from collections import namedtuple 2from collections import namedtuple
3 3from ..py2compat import with_metaclass
4
5def with_metaclass(meta, *bases):
6 return meta("NewBase", bases, {})
7 4
8 5
9class Field(namedtuple("Field", ["field", "default", "formatter"])): 6class 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
7dropped this module can be removed and imports can be updated. 7dropped this module can be removed and imports can be updated.
8""" 8"""
9 9
10
11def with_metaclass(meta, *bases):
12 return meta("NewBase", bases, {})
13
14
10try: 15try:
11 from configparser import ConfigParser 16 from configparser import ConfigParser
12except ImportError: 17except ImportError: