aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/namedtuple_with_abc.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/namedtuple_with_abc.py')
-rw-r--r--lib/bb/namedtuple_with_abc.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/bb/namedtuple_with_abc.py b/lib/bb/namedtuple_with_abc.py
index 32f2fc642..e46dbf084 100644
--- a/lib/bb/namedtuple_with_abc.py
+++ b/lib/bb/namedtuple_with_abc.py
@@ -1,6 +1,8 @@
# http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/
-#!/usr/bin/env python
# Copyright (c) 2011 Jan Kaliszewski (zuo). Available under the MIT License.
+#
+# SPDX-License-Identifier: MIT
+#
"""
namedtuple_with_abc.py:
@@ -59,17 +61,9 @@ class _NamedTupleABCMeta(ABCMeta):
return ABCMeta.__new__(mcls, name, bases, namespace)
-exec(
- # Python 2.x metaclass declaration syntax
- """class _NamedTupleABC(object):
- '''The abstract base class + mix-in for named tuples.'''
- __metaclass__ = _NamedTupleABCMeta
- _fields = abstractproperty()""" if version_info[0] < 3 else
- # Python 3.x metaclass declaration syntax
- """class _NamedTupleABC(metaclass=_NamedTupleABCMeta):
- '''The abstract base class + mix-in for named tuples.'''
- _fields = abstractproperty()"""
-)
+class _NamedTupleABC(metaclass=_NamedTupleABCMeta):
+ '''The abstract base class + mix-in for named tuples.'''
+ _fields = abstractproperty()
_namedtuple.abc = _NamedTupleABC