Adding pylint exception

This commit is contained in:
Michael Lazar
2017-09-06 01:27:40 -04:00
parent 9631521805
commit b73e902d4a

View File

@@ -33,11 +33,11 @@ def patch_webbrowser():
https://bugs.python.org/issue31348
"""
if sys.platform == 'darwin':
if sys.platform != 'darwin' or 'BROWSER' not in os.environ:
return
# This is a copy of what's at the end of webbrowser.py, except that
# it adds MacOSXOSAScript entries instead of GenericBrowser entries.
if "BROWSER" in os.environ:
_userchoices = os.environ["BROWSER"].split(os.pathsep)
for cmdline in reversed(_userchoices):
if cmdline in ('safari', 'firefox', 'chrome', 'default'):
@@ -46,6 +46,7 @@ def patch_webbrowser():
webbrowser.register(cmdline, None, browser, update_tryorder=-1)
except AttributeError:
# 3.7 nightly build changed the method signature
# pylint: disable=unexpected-keyword-arg
webbrowser.register(cmdline, None, browser, preferred=True)