mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
Patch# 1258 by Christian Heimes: kill basestring.
I like this because it makes the code shorter! :-)
This commit is contained in:
parent
60d241f135
commit
3172c5d263
77 changed files with 171 additions and 217 deletions
|
@ -150,10 +150,10 @@ def filterwarnings(action, message="", category=Warning, module="", lineno=0,
|
|||
import re
|
||||
assert action in ("error", "ignore", "always", "default", "module",
|
||||
"once"), "invalid action: %r" % (action,)
|
||||
assert isinstance(message, basestring), "message must be a string"
|
||||
assert isinstance(message, str), "message must be a string"
|
||||
assert isinstance(category, type), "category must be a class"
|
||||
assert issubclass(category, Warning), "category must be a Warning subclass"
|
||||
assert isinstance(module, basestring), "module must be a string"
|
||||
assert isinstance(module, str), "module must be a string"
|
||||
assert isinstance(lineno, int) and lineno >= 0, \
|
||||
"lineno must be an int >= 0"
|
||||
item = (action, re.compile(message, re.I), category,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue