Skip to content

Commit 957b37e

Browse files
[py] Only give deprecation warning if Profile is being used in options
1 parent d798b52 commit 957b37e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

py/selenium/webdriver/firefox/options.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@ def profile(self) -> FirefoxProfile:
107107
"""
108108
:Returns: The Firefox profile to use.
109109
"""
110-
warnings.warn(
111-
"Getting a profile has been deprecated.",
112-
DeprecationWarning,
113-
stacklevel=2
114-
)
110+
if self._profile:
111+
warnings.warn(
112+
"Getting a profile has been deprecated.",
113+
DeprecationWarning,
114+
stacklevel=2
115+
)
115116
return self._profile
116117

117118
@profile.setter

0 commit comments

Comments
 (0)