Skip to content

Commit

Permalink
Use repr(...) instead of "%r" % ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Unrud authored and Unrud committed Jul 22, 2017
1 parent d0aacd3 commit 1f4fb9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions radicale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def collect_allowed_items(self, items, user):
write_allowed_items.append(item)
self.logger.debug(
"%s has %s access to %s",
"%r" % user if user else "anonymous user",
repr(user) if user else "anonymous user",
" and ".join(text_status) if text_status else "NO", target)
return read_allowed_items, write_allowed_items

Expand Down Expand Up @@ -355,7 +355,7 @@ def response(status, headers=(), answer=None):

remote_host = "unknown"
if environ.get("REMOTE_HOST"):
remote_host = "%r" % environ["REMOTE_HOST"]
remote_host = repr(environ["REMOTE_HOST"])
elif environ.get("REMOTE_ADDR"):
remote_host = environ["REMOTE_ADDR"]
if environ.get("HTTP_X_FORWARDED_FOR"):
Expand Down Expand Up @@ -464,7 +464,7 @@ def response(status, headers=(), answer=None):
environ, base_prefix, path, user)
if (status, headers, answer) == NOT_ALLOWED:
self.logger.info("Access to %r denied for %s", path,
"%r" % user if user else "anonymous user")
repr(user) if user else "anonymous user")
else:
status, headers, answer = NOT_ALLOWED

Expand Down

0 comments on commit 1f4fb9e

Please sign in to comment.