mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Change type check to isinstance in pipes (GH-27291) (GH-27416)
(cherry picked from commit 9ffbb89946
)
Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
This commit is contained in:
parent
0993837766
commit
5eabf246b6
1 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ class Template:
|
|||
|
||||
def append(self, cmd, kind):
|
||||
"""t.append(cmd, kind) adds a new step at the end."""
|
||||
if type(cmd) is not type(''):
|
||||
if not isinstance(cmd, str):
|
||||
raise TypeError('Template.append: cmd must be a string')
|
||||
if kind not in stepkinds:
|
||||
raise ValueError('Template.append: bad kind %r' % (kind,))
|
||||
|
@ -125,7 +125,7 @@ class Template:
|
|||
|
||||
def prepend(self, cmd, kind):
|
||||
"""t.prepend(cmd, kind) adds a new step at the front."""
|
||||
if type(cmd) is not type(''):
|
||||
if not isinstance(cmd, str):
|
||||
raise TypeError('Template.prepend: cmd must be a string')
|
||||
if kind not in stepkinds:
|
||||
raise ValueError('Template.prepend: bad kind %r' % (kind,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue