mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
Enable pycodestyle W605 (invalid escape sequence).
The only changes visible at the AST level, checked using https://github.com/asottile/astpretty, are zerver/lib/test_fixtures.py: '\x1b\\[(1|0)m' ↦ '\\x1b\\[(1|0)m' '\\[[X| ]\\] (\\d+_.+)\n' ↦ '\\[[X| ]\\] (\\d+_.+)\\n' which is fine because re treats '\\x1b' and '\\n' the same way as '\x1b' and '\n'. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
7b8d3023f5
commit
037f696d26
@@ -23,7 +23,7 @@ def get_subdomain(request: HttpRequest) -> str:
|
||||
|
||||
host = request.get_host().lower()
|
||||
|
||||
m = re.search('\.%s(:\d+)?$' % (settings.EXTERNAL_HOST,),
|
||||
m = re.search(r'\.%s(:\d+)?$' % (settings.EXTERNAL_HOST,),
|
||||
host)
|
||||
if m:
|
||||
subdomain = host[:m.start()]
|
||||
@@ -32,7 +32,7 @@ def get_subdomain(request: HttpRequest) -> str:
|
||||
return subdomain
|
||||
|
||||
for subdomain, realm_host in settings.REALM_HOSTS.items():
|
||||
if re.search('^%s(:\d+)?$' % (realm_host,),
|
||||
if re.search(r'^%s(:\d+)?$' % (realm_host,),
|
||||
host):
|
||||
return subdomain
|
||||
|
||||
|
||||
Reference in New Issue
Block a user