◐ Shell
clean mode source ↗

Message 238317 - Python tracker

Working on issue23673 I saw this in the new signal.py:

+def _enum_to_int(value):
+    """Convert an IntEnum member to a numeric value.
+    If it's not a IntEnum member return the value itself.
+    """
+    try:
+        return int(value)
+    except (ValueError, TypeError):
+        return value

The SIG, etc, constants are based on IntEnum, so they are already numeric values, and this function is unnecessary.