Skip to content

Commit

Permalink
refactor: remove use of Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tysmith committed Oct 31, 2024
1 parent 36b16cf commit d8a9e62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions grizzly/target/puppet_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from platform import system
from signal import SIGABRT
from tempfile import TemporaryDirectory, mkdtemp
from typing import Any, Optional, cast
from typing import Any, cast

from ffpuppet import BrowserTimeoutError, Debugger, FFPuppet, LaunchError, Reason
from ffpuppet.helpers import certutil_available, certutil_find
Expand Down Expand Up @@ -95,7 +95,7 @@ def __init__(
**kwds: dict[str, Any],
) -> None:
LOG.debug("ffpuppet version: %s", package_version("ffpuppet"))
certs = cast(Optional[CertificateBundle], kwds.pop("certs", None))
certs = cast(CertificateBundle | None, kwds.pop("certs", None))
# only pass certs to FFPuppet if certutil is available
# otherwise certs can't be used
if certs and not certutil_available(certutil_find(binary)):
Expand Down Expand Up @@ -126,7 +126,7 @@ def __init__(
# create Puppet object
self._puppet = FFPuppet(
debugger=self._debugger,
headless=cast(Optional[str], kwds.pop("headless", None)),
headless=cast(str | None, kwds.pop("headless", None)),
working_path=str(grz_tmp("target")),
)
if kwds:
Expand Down Expand Up @@ -259,7 +259,7 @@ def launch(self, location: str) -> None:
memory_limit=self.memory_limit,
prefs_js=self._prefs,
extension=[self._extension] if self._extension else None,
env_mod=cast(dict[str, Optional[str]], env_mod),
env_mod=cast(dict[str, str | None], env_mod),
cert_files=[self.certs.root] if self.certs else None,
)
except LaunchError as exc:
Expand Down

0 comments on commit d8a9e62

Please sign in to comment.