Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Nov 19, 2023
1 parent a123ce2 commit acf29ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aiohttp_devtools/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def formatMessage(self, record: logging.LogRecord) -> str:

def formatException(self, ei: _Ei) -> str:
sio = StringIO()
traceback.print_exception(*ei, file=sio)
traceback.print_exception(*ei, file=sio) # type: ignore[misc]
stack = sio.getvalue()
sio.close()
if self.stream_is_tty and pyg_lexer:
Expand Down
10 changes: 5 additions & 5 deletions aiohttp_devtools/runserver/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
try:
from aiohttp_jinja2 import static_root_key
except ImportError:
static_root_key = None
static_root_key = None # type: ignore[assignment]

LIVE_RELOAD_HOST_SNIPPET = '\n<script src="http://{}:{}/livereload.js"></script>\n'
LIVE_RELOAD_LOCAL_SNIPPET = b'\n<script src="/livereload.js"></script>\n'
Expand All @@ -41,20 +41,20 @@

def _set_static_url(app: web.Application, url: str) -> None:
if static_root_key is None: # TODO: Remove fallback
with warnings.catch_warnings():
with warnings.catch_warnings(): # type: ignore[unreachable]
app["static_root_url"] = MutableValue(url)
else:
app[static_root_key] = MutableValue(url)
app[static_root_key] = MutableValue(url) # type: ignore[misc]
for subapp in app._subapps:
_set_static_url(subapp, url)


def _change_static_url(app: web.Application, url: str) -> None:
if static_root_key is None: # TODO: Remove fallback
with warnings.catch_warnings():
with warnings.catch_warnings(): # type: ignore[unreachable]
app["static_root_url"].change(url)
else:
app[static_root_key].change(url)
app[static_root_key].change(url) # type: ignore[attr-defined]
for subapp in app._subapps:
_change_static_url(subapp, url)

Expand Down

0 comments on commit acf29ce

Please sign in to comment.