Skip to content

Commit c8b22f9

Browse files
authored
Merge pull request #278 from plotly/andrew/remove_unused_code
andrew/remove unused code
2 parents daa6092 + 076b226 commit c8b22f9

File tree

4 files changed

+3
-47
lines changed

4 files changed

+3
-47
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- Remove unused system inspection code
12
- Add a set of helper functions to await for tab loading and send javascript
23
v1.2.1
34
- Use custom threadpool for functions that could be running during shutdown:

src/choreographer/browser_async.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from choreographer import protocol
1515

1616
from ._brokers import Broker
17-
from .browsers import BrowserClosedError, BrowserDepsError, BrowserFailedError, Chromium
17+
from .browsers import BrowserClosedError, BrowserFailedError, Chromium
1818
from .channels import ChannelClosedError, Pipe
1919
from .protocol.devtools_async import Session, Target
2020
from .utils import TmpDirWarning, _manual_thread_pool
@@ -166,11 +166,6 @@ def run() -> subprocess.Popen[bytes] | subprocess.Popen[str]: # depends on args
166166
await asyncio.sleep(0) # let watchdog start
167167
await self.populate_targets()
168168
except (BrowserClosedError, BrowserFailedError, asyncio.CancelledError) as e:
169-
if (
170-
hasattr(self._browser_impl, "missing_libs")
171-
and self._browser_impl.missing_libs # type: ignore[reportAttributeAccessIssue]
172-
):
173-
raise BrowserDepsError from e
174169
raise BrowserFailedError(
175170
"The browser seemed to close immediately after starting.",
176171
"You can set the `logging.Logger` level lower to see more output.",

src/choreographer/browsers/_errors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class BrowserFailedError(RuntimeError):
66
"""An error for when the browser fails to launch."""
77

88

9+
# not currently used but keeping copy + not breaking API
910
class BrowserDepsError(BrowserFailedError):
1011
"""An error for when the browser is closed because of missing libs."""
1112

src/choreographer/browsers/chromium.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -115,46 +115,6 @@ def logger_parser(
115115

116116
return True
117117

118-
def _libs_ok(self) -> bool:
119-
"""Return true if libs ok."""
120-
if self.skip_local:
121-
_logger.debug(
122-
"If we HAVE to skip local.",
123-
)
124-
return True
125-
_logger.debug("Checking for libs needed.")
126-
if platform.system() != "Linux":
127-
_logger.debug("We're not in linux, so no need for check.")
128-
return True
129-
p = None
130-
try:
131-
_logger.debug(f"Trying ldd {self.path}")
132-
p = subprocess.run( # noqa: S603, validating run with variables
133-
[ # noqa: S607 path is all we have
134-
"ldd",
135-
str(self.path),
136-
],
137-
capture_output=True,
138-
timeout=5,
139-
check=True,
140-
)
141-
except Exception as e: # noqa: BLE001
142-
msg = "ldd failed."
143-
stderr = p.stderr.decode() if p and p.stderr else None
144-
# Log failure as INFO rather than WARNING so that it's hidden by default,
145-
# since browser may succeed even if ldd fails
146-
_logger.info(
147-
msg # noqa: G003 + in log
148-
+ f" e: {e}, stderr: {stderr}",
149-
)
150-
return False
151-
if b"not found" in p.stdout:
152-
msg = "Found deps missing in chrome"
153-
_logger.debug2(msg + f" {p.stdout.decode()}")
154-
return False
155-
_logger.debug("No problems found with dependencies")
156-
return True
157-
158118
def __init__(
159119
self,
160120
channel: ChannelInterface,
@@ -220,7 +180,6 @@ def pre_open(self) -> None:
220180
path=self._tmp_dir_path,
221181
sneak=self._is_isolated,
222182
)
223-
self.missing_libs = not self._libs_ok()
224183
_logger.info(f"Temporary directory at: {self.tmp_dir.path}")
225184

226185
def is_isolated(self) -> bool:

0 commit comments

Comments
 (0)