From d2d9cd600133fbc9ee2909a4f949d0f67c6913de Mon Sep 17 00:00:00 2001 From: gruebel Date: Thu, 22 Jul 2021 21:52:44 +0200 Subject: [PATCH] Change type check to isinstance in pipes --- Lib/pipes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/pipes.py b/Lib/pipes.py index f1a16f63de60a0a..8cc74b0f1f781b1 100644 --- a/Lib/pipes.py +++ b/Lib/pipes.py @@ -109,7 +109,7 @@ def debug(self, flag): 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 @@ def append(self, cmd, kind): 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,))