[py] Modernise conditionals (#8954)
[py] Modernise conditionals (#8954)

Co-authored-by: David Burns <d362af86e495513f26934099bd8e8ac6f8be9d8e@theautomatedtester.co.uk>
valfirst/selenium,SeleniumHQ/selenium,SeleniumHQ/selenium,titusfortner/selenium,titusfortner/selenium,HtmlUnit/selenium,titusfortner/selenium,joshmgrant/selenium,valfirst/selenium,valfirst/selenium,HtmlUnit/selenium,titusfortner/selenium,joshmgrant/selenium,valfirst/selenium,joshmgrant/selenium,titusfortner/selenium,valfirst/selenium,SeleniumHQ/selenium,HtmlUnit/selenium,joshmgrant/selenium,HtmlUnit/selenium,joshmgrant/selenium,valfirst/selenium,SeleniumHQ/selenium,valfirst/selenium,SeleniumHQ/selenium,SeleniumHQ/selenium,titusfortner/selenium,valfirst/selenium,titusfortner/selenium,SeleniumHQ/selenium,joshmgrant/selenium,HtmlUnit/selenium,SeleniumHQ/selenium,titusfortner/selenium,SeleniumHQ/selenium,joshmgrant/selenium,SeleniumHQ/selenium,HtmlUnit/selenium,titusfortner/selenium,joshmgrant/selenium,valfirst/selenium,HtmlUnit/selenium,valfirst/selenium,SeleniumHQ/selenium,valfirst/selenium,joshmgrant/selenium,HtmlUnit/selenium,joshmgrant/selenium,joshmgrant/selenium,titusfortner/selenium,HtmlUnit/selenium,HtmlUnit/selenium,titusfortner/selenium