[Python-checkins] gh-99281: [csv] remove try/except, `complex` always exists (#99282)

AlexWaygood webhook-mailer at python.org
Thu Nov 10 05:38:16 EST 2022


https://github.com/python/cpython/commit/d6f276799754f0eab24e1c195d6dca1bc0aadf14
commit: d6f276799754f0eab24e1c195d6dca1bc0aadf14
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: AlexWaygood <Alex.Waygood at Gmail.com>
date: 2022-11-10T10:37:57Z
summary:

gh-99281: [csv] remove try/except, `complex` always exists (#99282)

files:
M Lib/csv.py

diff --git a/Lib/csv.py b/Lib/csv.py
index 0de5656a4eed..309a8f3f4863 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -165,11 +165,6 @@ def writerows(self, rowdicts):
 
     __class_getitem__ = classmethod(types.GenericAlias)
 
-# Guard Sniffer's type checking against builds that exclude complex()
-try:
-    complex
-except NameError:
-    complex = float
 
 class Sniffer:
     '''



More information about the Python-checkins mailing list