Skip to content

Commit 34388c7

Browse files
Michael Howitzcjwatson
andauthored
Apply suggestions from code review
Co-authored-by: Colin Watson <[email protected]>
1 parent 9cd8099 commit 34388c7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/zope/publisher/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def __repr__(self):
229229
items = list(self.__dict__.items())
230230
items.sort()
231231
return ("{"
232-
+ ", ".join(["{}: {}".format(key, repr(value))
232+
+ ", ".join(["{}: {!r}".format(key, value)
233233
for key, value in items]) + "}")
234234

235235

src/zope/publisher/interfaces/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __str__(self):
8686
ob = repr(self.ob)
8787
except: # noqa: E722 do not use bare 'except'
8888
ob = 'unprintable object'
89-
return 'Object: {}, name: {}'.format(ob, repr(self.name))
89+
return 'Object: {}, name: {!r}'.format(ob, self.name)
9090

9191

9292
class IDebugError(ITraversalException):

src/zope/publisher/tests/test_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class Item:
208208
"""Required docstring for the publisher."""
209209

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

213213
self.app = AppRoot()
214214
self.app.folder = Folder()

src/zope/publisher/tests/test_xmlrpcrequest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Folder:
8282
class Item:
8383

8484
def __call__(self, a, b):
85-
return "{}, {}".format(repr(a), repr(b))
85+
return "{!r}, {!r}".format(a, b)
8686

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

0 commit comments

Comments
 (0)