From 2740e2c88f952b7b6ca29ef0dc6216c5ac19c7b1 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Mon, 30 Oct 2017 02:22:31 +0000 Subject: 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. --- pandora/models/__init__.py | 5 +---- 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 @@ from datetime import datetime from collections import namedtuple - - -def with_metaclass(meta, *bases): - return meta("NewBase", bases, {}) +from ..py2compat import with_metaclass 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 dropped this module can be removed and imports can be updated. """ + +def with_metaclass(meta, *bases): + return meta("NewBase", bases, {}) + + try: from configparser import ConfigParser except ImportError: -- cgit v1.2.3