summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-28 14:08:51 (GMT)
committerGitHub <noreply@github.com>2021-07-28 14:08:51 (GMT)
commit5eabf246b609466c4cd244d32ecb2f780cfeed8c (patch)
tree2485fc780ffa8c026f620eccf4c28188a8a8ab98
parent0993837766ee4b88de593eaf3a9a14852c82724c (diff)
downloadcpython-5eabf246b609466c4cd244d32ecb2f780cfeed8c.zip
cpython-5eabf246b609466c4cd244d32ecb2f780cfeed8c.tar.gz
cpython-5eabf246b609466c4cd244d32ecb2f780cfeed8c.tar.bz2
Change type check to isinstance in pipes (GH-27291) (GH-27416)
(cherry picked from commit 9ffbb899462b819864f777d0228fb8f1bb89b018) Co-authored-by: Anton GrĂ¼bel <anton.gruebel@gmail.com>
-rw-r--r--Lib/pipes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pipes.py b/Lib/pipes.py
index f1a16f6..8cc74b0 100644
--- a/Lib/pipes.py
+++ b/Lib/pipes.py
@@ -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,))