remove import error handling

This commit is contained in:
Will McGugan
2022-10-22 17:10:57 +01:00
parent 7e9b296c93
commit 2d56cb8512
2 changed files with 8 additions and 14 deletions

View File

@@ -457,11 +457,11 @@ class App(Generic[ReturnType], DOMNode):
Args:
verbosity (int, optional): Verbosity level 0-3. Defaults to 1.
"""
devtools = self.devtools
if devtools is None:
if not self.devtools_enabled:
return
devtools = self.devtools
if verbosity.value > LogVerbosity.NORMAL.value and not devtools.verbose:
return

View File

@@ -1,17 +1,11 @@
from __future__ import annotations
import asyncio
try:
from aiohttp.web import run_app
from aiohttp.web_app import Application
from aiohttp.web_request import Request
from aiohttp.web_routedef import get
from aiohttp.web_ws import WebSocketResponse
except ImportError:
raise ImportError(
"Textual Devtools requires installation of the 'dev' extra dependencies."
)
from aiohttp.web import run_app
from aiohttp.web_app import Application
from aiohttp.web_request import Request
from aiohttp.web_routedef import get
from aiohttp.web_ws import WebSocketResponse
from textual.devtools.client import DEVTOOLS_PORT
from textual.devtools.service import DevtoolsService