[issue21076] Turn signal.SIG* constants into enums

Ethan Furman report at bugs.python.org
Tue Mar 17 18:06:24 CET 2015


Ethan Furman added the comment:

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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21076>
_______________________________________


More information about the Python-bugs-list mailing list