Bug 1680346 [wpt PR 26726] - Update vendored enum34 to 1.10, a=testonly

Automatic update from web-platform-tests
Update vendored enum34 to 1.10

--

wpt-commits: 8dce02d5eeabbb228dadb5c24bc27138c52a352c
wpt-pr: 26726
This commit is contained in:
James Graham 2020-12-04 03:54:56 +00:00 коммит произвёл moz-wptsync-bot
Родитель b73058b961
Коммит 22c3dbf512
6 изменённых файлов: 39 добавлений и 2251 удалений

Просмотреть файл

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: enum34
Version: 1.1.6
Version: 1.1.10
Summary: Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
Home-page: https://bitbucket.org/stoneleaf/enum34
Author: Ethan Furman
@ -57,6 +57,4 @@ Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Provides: enum

Просмотреть файл

@ -4,7 +4,7 @@ import sys as _sys
__all__ = ['Enum', 'IntEnum', 'unique']
version = 1, 1, 6
version = 1, 1, 10
pyver = float('%s.%s' % _sys.version_info[:2])
@ -183,7 +183,8 @@ class EnumMeta(type):
else:
del classdict['_order_']
if pyver < 3.0:
_order_ = _order_.replace(',', ' ').split()
if isinstance(_order_, basestring):
_order_ = _order_.replace(',', ' ').split()
aliases = [name for name in members if name not in _order_]
_order_ += aliases
@ -463,7 +464,7 @@ class EnumMeta(type):
_order_.append(member_name)
# only set _order_ in classdict if name/value was not from a mapping
if not isinstance(item, basestring):
classdict['_order_'] = ' '.join(_order_)
classdict['_order_'] = _order_
enum_class = metacls.__new__(metacls, class_name, bases, classdict)
# TODO: replace the frame hack if a blessed way to know the calling

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -452,8 +452,8 @@ class TestEnum(unittest.TestCase):
self.assertEqual(dates[Season.AUTUMN], '1031')
def test_enum_duplicates(self):
_order_ = "SPRING SUMMER AUTUMN WINTER"
class Season(Enum):
_order_ = "SPRING SUMMER AUTUMN WINTER"
SPRING = 1
SUMMER = 2
AUTUMN = FALL = 3
@ -665,7 +665,7 @@ class TestEnum(unittest.TestCase):
protocol=(0, HIGHEST_PROTOCOL))
def test_exploding_pickle(self):
BadPickle = Enum('BadPickle', 'dill sweet bread-n-butter')
BadPickle = Enum('BadPickle', 'dill sweet bread_n_butter')
enum._make_class_unpicklable(BadPickle)
globals()['BadPickle'] = BadPickle
test_pickle_exception(self.assertRaises, TypeError, BadPickle.dill)
@ -813,6 +813,27 @@ class TestEnum(unittest.TestCase):
self.assertTrue(e in SummerMonth)
self.assertTrue(type(e) is SummerMonth)
def test_programatic_function_iterable_with_weird_names(self):
SummerMonth = Enum(
'SummerMonth',
(('june', 1), ('july', 2), ('august', 3), ('fabulous september', 4))
)
lst = list(SummerMonth)
self.assertEqual(len(lst), len(SummerMonth))
self.assertEqual(len(SummerMonth), 4, SummerMonth)
self.assertEqual(
[SummerMonth.june, SummerMonth.july, SummerMonth.august, SummerMonth['fabulous september']],
lst,
)
for i, month in enumerate('june july august'.split() + ['fabulous september']):
i += 1
e = SummerMonth(i)
self.assertEqual(int(e.value), i)
self.assertNotEqual(e, i)
self.assertEqual(e.name, month)
self.assertTrue(e in SummerMonth)
self.assertTrue(type(e) is SummerMonth)
def test_programatic_function_from_dict(self):
SummerMonth = Enum(
'SummerMonth',

Просмотреть файл

@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0

Просмотреть файл

@ -9,6 +9,14 @@ if sys.version_info[:2] < (2, 7):
else:
required = []
# Don't shadow builtin enum package if we are being installed on a
# recent Python. This causes conflicts since at least 3.6:
# https://bitbucket.org/stoneleaf/enum34/issues/19/enum34-isnt-compatible-with-python-36
if sys.version_info[:2] < (3, 4):
packages = ['enum']
else:
packages = []
long_desc = '''\
enum --- support for enumerations
========================================
@ -54,15 +62,15 @@ Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
py2_only = ()
py3_only = ()
make = [
'rst2pdf enum/doc/enum.rst --output=enum/doc/enum.pdf',
# 'rst2pdf enum/doc/enum.rst --output=enum/doc/enum.pdf',
]
data = dict(
name='enum34',
version='1.1.6',
version='1.1.10',
url='https://bitbucket.org/stoneleaf/enum34',
packages=['enum'],
packages=packages,
package_data={
'enum' : [
'LICENSE',
@ -90,8 +98,6 @@ data = dict(
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)