Check for none

main
Bob Mottram 2023-03-23 18:56:36 +00:00
parent a193639b53
commit 1e5e38d8a8
1 changed files with 5 additions and 4 deletions

View File

@ -2041,10 +2041,11 @@ def html_common_emoji(base_dir: str, no_of_emoji: int) -> str:
def text_mode_browser(ua_str: str) -> bool:
"""Does the user agent indicate a text mode browser?
"""
text_mode_agents = ('Lynx/', 'w3m/', 'Links (', 'Emacs/', 'ELinks')
for agent in text_mode_agents:
if agent in ua_str:
return True
if ua_str:
text_mode_agents = ('Lynx/', 'w3m/', 'Links (', 'Emacs/', 'ELinks')
for agent in text_mode_agents:
if agent in ua_str:
return True
return False