mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #20315: Removed support for backward compatibility with early 2.x versions.
This commit is contained in:
parent
6c01e38677
commit
7e52705ee3
6 changed files with 3 additions and 93 deletions
|
@ -645,14 +645,8 @@ class Option:
|
|||
self.type = "string"
|
||||
else:
|
||||
# Allow type objects or builtin type conversion functions
|
||||
# (int, str, etc.) as an alternative to their names. (The
|
||||
# complicated check of builtins is only necessary for
|
||||
# Python 2.1 and earlier, and is short-circuited by the
|
||||
# first check on modern Pythons.)
|
||||
import builtins
|
||||
if ( isinstance(self.type, type) or
|
||||
(hasattr(self.type, "__name__") and
|
||||
getattr(builtins, self.type.__name__, None) is self.type) ):
|
||||
# (int, str, etc.) as an alternative to their names.
|
||||
if isinstance(self.type, type):
|
||||
self.type = self.type.__name__
|
||||
|
||||
if self.type == "str":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue