Skip to content

Commit 1b15277

Browse files
TheBukyTheBuky
authored andcommitted
Repport the 'add_metaclas' decorator form django.utils.six to handle metaclass overwriting (fix mistakes)
1 parent d93d18d commit 1b15277

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

pipeline/decorator.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
handle MetaClass overwright working on both versions (or dropping python 2 support).
88
"""
99

10-
def with_metaclass(meta, *bases):
11-
"""Create a base class with a metaclass."""
12-
# This requires a bit of explanation: the basic idea is to make a dummy
13-
# metaclass for one level of class instantiation that replaces itself with
14-
# the actual metaclass.
15-
class metaclass(meta):
16-
17-
def __new__(cls, name, this_bases, d):
18-
return meta(name, bases, d)
19-
return type.__new__(metaclass, 'temporary_class', (), {})
20-
21-
2210
def add_metaclass(metaclass):
2311
"""Class decorator for creating a class with a metaclass."""
2412
def wrapper(cls):

pipeline/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
from django.contrib.staticfiles.storage import staticfiles_storage
66
from django.utils.functional import cached_property
77
try:
8-
from django.utils.six import iteritems
8+
from django.utils.six import iteritems, add_metaclass
99
except ImportError:
10+
from .decorator import add_metaclass
1011
def iteritems(dictionary):
1112
return dictionary.items()
1213

1314
from .collector import default_collector
1415
from .conf import settings
15-
from .decorator import add_metaclass
1616
from .packager import Packager
1717

1818

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='django-pipeline',
9-
version='1.6.14',
9+
version='1.7.0',
1010
description='Pipeline is an asset packaging library for Django.',
1111
long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' +
1212
io.open('HISTORY.rst', encoding='utf-8').read(),

0 commit comments

Comments
 (0)