Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ def _match(self, cre, s):
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()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what this actually wanted to be was r'%s' % cre.pattern.replace('\\\\', '\\'), but of course that doesn't work in all cases. It would be nice if we had a codec that produced raw string representation (it would have to fall back to repr for cases that can't be represented as raw strings).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will think about it.

return self.mo is not None


Expand Down
4 changes: 2 additions & 2 deletions Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Lib/multiprocessing/sharedctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args):
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:
Expand Down