Skip to content

Commit

Permalink
[py] webkitgtk: log_path -> log_output (#14618)
Browse files Browse the repository at this point in the history
* [py] webkitgtk: log_path -> log_output

* apply suggestion

* add warning for old para

---------

Co-authored-by: Sri Harsha <[email protected]>
Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
3 people authored Oct 28, 2024
1 parent 635a88a commit ddfb3d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions py/selenium/webdriver/webkitgtk/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import typing
import warnings

from selenium.webdriver.common import service

Expand All @@ -28,7 +29,7 @@ class Service(service.Service):
:param executable_path: install path of the WebKitWebDriver executable, defaults to `WebKitWebDriver`.
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
:param service_args: (Optional) List of args to be passed to the subprocess when launching the executable.
:param log_path: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
:param log_output: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
"""

Expand All @@ -37,16 +38,20 @@ def __init__(
executable_path: str = DEFAULT_EXECUTABLE_PATH,
port: int = 0,
log_path: typing.Optional[str] = None,
log_output: typing.Optional[str] = None,
service_args: typing.Optional[typing.List[str]] = None,
env: typing.Optional[typing.Mapping[str, str]] = None,
**kwargs,
) -> None:
self.service_args = service_args or []
log_file = open(log_path, "wb") if log_path else None
if log_path is not None:
warnings.warn("log_path is deprecated, use log_output instead", DeprecationWarning, stacklevel=2)
log_path = open(log_path, "wb")
log_output = open(log_output, "wb") if log_output else None
super().__init__(
executable_path=executable_path,
port=port,
log_file=log_file,
log_output=log_path or log_output,
env=env,
**kwargs,
)
Expand Down

0 comments on commit ddfb3d8

Please sign in to comment.