]> granicus.if.org Git - python/commitdiff
bpo-32157: Removed explicit quotes around %r and {!r}. (#4582)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 28 Nov 2017 20:54:42 +0000 (22:54 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Nov 2017 20:54:42 +0000 (22:54 +0200)
Lib/imaplib.py
Lib/inspect.py
Lib/multiprocessing/sharedctypes.py
Lib/test/test_queue.py

index 1c0b03bff8a3792c2fda3ca566690889daa1b4be..e1cece0b283f2be0870b7a45bbc3217da92bb15b 100644 (file)
@@ -1166,7 +1166,7 @@ class IMAP4:
         self.mo = cre.match(s)
         if __debug__:
             if self.mo is not None and self.debug >= 5:
-                self._mesg("\tmatched r'%r' => %r" % (cre.pattern, self.mo.groups()))
+                self._mesg("\tmatched %r => %r" % (cre.pattern, self.mo.groups()))
         return self.mo is not None
 
 
index 69f2b6209f65c6eb33994fea95ba10b120c5ed0e..8c121ce96c415871122169ac6c0363604a7811e1 100644 (file)
@@ -1381,7 +1381,7 @@ def getclosurevars(func):
         func = func.__func__
 
     if not isfunction(func):
-        raise TypeError("'{!r}' is not a Python function".format(func))
+        raise TypeError("{!r} is not a Python function".format(func))
 
     code = func.__code__
     # Nonlocal references are named in co_freevars and resolved
@@ -1624,7 +1624,7 @@ def getgeneratorlocals(generator):
     bound values."""
 
     if not isgenerator(generator):
-        raise TypeError("'{!r}' is not a Python generator".format(generator))
+        raise TypeError("{!r} is not a Python generator".format(generator))
 
     frame = getattr(generator, "gi_frame", None)
     if frame is not None:
index 066cf8f031ddeb76e07931ad533ae4bf91b7cf76..6071707027bea46dccfc4d92fb3195060faf07ce 100644 (file)
@@ -78,7 +78,7 @@ def Value(typecode_or_type, *args, lock=True, ctx=None):
         ctx = ctx or get_context()
         lock = ctx.RLock()
     if not hasattr(lock, 'acquire'):
-        raise AttributeError("'%r' has no method 'acquire'" % lock)
+        raise AttributeError("%r has no method 'acquire'" % lock)
     return synchronized(obj, lock, ctx=ctx)
 
 def Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None):
@@ -92,7 +92,7 @@ def Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None):
         ctx = ctx or get_context()
         lock = ctx.RLock()
     if not hasattr(lock, 'acquire'):
-        raise AttributeError("'%r' has no method 'acquire'" % lock)
+        raise AttributeError("%r has no method 'acquire'" % lock)
     return synchronized(obj, lock, ctx=ctx)
 
 def copy(obj):
index 35466c1eae39d0f823cdd2314f6bacb90256cf10..6ee906c4d2665a763e7d3ba9abe31c28017fe0b1 100644 (file)
@@ -54,7 +54,7 @@ class BlockingTestMixin:
             self.result = block_func(*block_args)
             # If block_func returned before our thread made the call, we failed!
             if not thread.startedEvent.is_set():
-                self.fail("blocking function '%r' appeared not to block" %
+                self.fail("blocking function %r appeared not to block" %
                           block_func)
             return self.result
         finally: