Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Colin Watson <[email protected]>
  • Loading branch information
Michael Howitz and cjwatson authored Aug 29, 2023
1 parent 9cd8099 commit 34388c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/zope/publisher/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __repr__(self):
items = list(self.__dict__.items())
items.sort()
return ("{"
+ ", ".join(["{}: {}".format(key, repr(value))
+ ", ".join(["{}: {!r}".format(key, value)
for key, value in items]) + "}")


Expand Down
2 changes: 1 addition & 1 deletion src/zope/publisher/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __str__(self):
ob = repr(self.ob)
except: # noqa: E722 do not use bare 'except'
ob = 'unprintable object'
return 'Object: {}, name: {}'.format(ob, repr(self.name))
return 'Object: {}, name: {!r}'.format(ob, self.name)


class IDebugError(ITraversalException):
Expand Down
2 changes: 1 addition & 1 deletion src/zope/publisher/tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Item:
"""Required docstring for the publisher."""

def __call__(self, a, b):
return ("{}, {}".format(repr(a), repr(b))).encode('latin1')
return ("{!r}, {!r}".format(a, b)).encode('latin1')

self.app = AppRoot()
self.app.folder = Folder()
Expand Down
2 changes: 1 addition & 1 deletion src/zope/publisher/tests/test_xmlrpcrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Folder:
class Item:

def __call__(self, a, b):
return "{}, {}".format(repr(a), repr(b))
return "{!r}, {!r}".format(a, b)

def doit(self, a, b):
return 'do something {} {}'.format(a, b)
Expand Down

0 comments on commit 34388c7

Please sign in to comment.