summaryrefslogtreecommitdiff
path: root/dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch')
-rw-r--r--dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch b/dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch
new file mode 100644
index 000000000000..53ade693a3ad
--- /dev/null
+++ b/dev-python/traitlets/files/traitlets-5.0.5-python3_10.patch
@@ -0,0 +1,33 @@
+From dbb604946745ed90c6e9f6ed17f2bde253042d52 Mon Sep 17 00:00:00 2001
+From: Olga <olgamatoula@gmail.com>
+Date: Fri, 7 May 2021 17:27:09 +0100
+Subject: [PATCH] Fix string assertion for python3.10
+
+---
+ traitlets/tests/test_traitlets_enum.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/traitlets/tests/test_traitlets_enum.py b/traitlets/tests/test_traitlets_enum.py
+index 769e830b..a87dd705 100644
+--- a/traitlets/tests/test_traitlets_enum.py
++++ b/traitlets/tests/test_traitlets_enum.py
+@@ -5,6 +5,7 @@
+
+ import unittest
+ import enum
++import sys
+ from traitlets import HasTraits, TraitError, Enum, UseEnum, CaselessStrEnum, FuzzyEnum
+
+
+@@ -87,7 +88,10 @@ def test_assign_scoped_enum_value_name(self):
+ example = self.Example()
+ example.color = value
+ self.assertIsInstance(example.color, Color)
+- self.assertEqual(str(example.color), value)
++ if sys.version_info < (3, 10):
++ self.assertEqual(str(example.color), value)
++ else:
++ self.assertEqual(repr(example.color), value)
+
+ def test_assign_bad_enum_value_name__raises_error(self):
+ # -- CONVERT: string => Enum value (item)