File: remove-bad-enum.py-calls.patch

package info (click to toggle)
python-taskflow 5.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,564 kB
  • sloc: python: 28,241; sh: 269; makefile: 24
file content (24 lines) | stat: -rw-r--r-- 931 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Remove bad enum.py calls
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Bug-Debian: https://bugs.debian.org/910447
Last-Update: 2018-10-07

Index: python-taskflow/taskflow/utils/misc.py
===================================================================
--- python-taskflow.orig/taskflow/utils/misc.py
+++ python-taskflow/taskflow/utils/misc.py
@@ -49,13 +49,6 @@ _SCHEME_REGEX = re.compile(r"^([A-Za-z][
 class StrEnum(str, enum.Enum):
     """An enumeration that is also a string and can be compared to strings."""
 
-    def __new__(cls, *args, **kwargs):
-        for a in args:
-            if not isinstance(a, str):
-                raise TypeError("Enumeration '%s' (%s) is not"
-                                " a string" % (a, type(a).__name__))
-        return super(StrEnum, cls).__new__(cls, *args, **kwargs)
-
 
 class StringIO(six.StringIO):
     """String buffer with some small additions."""