From 21d0eb460f3d6932cbf9544d636d22080bf386b6 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 20 Sep 2019 09:38:30 +0200 Subject: [PATCH] Fix Python 3.8 test regression --- tests/test_enum.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_enum.py b/tests/test_enum.py index 7fe9b618d..cea834d01 100644 --- a/tests/test_enum.py +++ b/tests/test_enum.py @@ -192,12 +192,15 @@ def test_binary_operators(): def test_enum_to_int(): - m.test_enum_to_int(m.Flags.Read) - m.test_enum_to_int(m.ClassWithUnscopedEnum.EMode.EFirstMode) - m.test_enum_to_uint(m.Flags.Read) - m.test_enum_to_uint(m.ClassWithUnscopedEnum.EMode.EFirstMode) - m.test_enum_to_long_long(m.Flags.Read) - m.test_enum_to_long_long(m.ClassWithUnscopedEnum.EMode.EFirstMode) + import sys + # Implicit conversion to integers is deprecated in Python >= 3.8 + if sys.version_info < (3, 8): + m.test_enum_to_int(m.Flags.Read) + m.test_enum_to_int(m.ClassWithUnscopedEnum.EMode.EFirstMode) + m.test_enum_to_uint(m.Flags.Read) + m.test_enum_to_uint(m.ClassWithUnscopedEnum.EMode.EFirstMode) + m.test_enum_to_long_long(m.Flags.Read) + m.test_enum_to_long_long(m.ClassWithUnscopedEnum.EMode.EFirstMode) def test_duplicate_enum_name():