Skip to content

Commit e5d003b

Browse files
committed
Move validation.
1 parent 3598c94 commit e5d003b

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

notebook/notebookapp.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,13 @@ def init_webapp(self):
14631463
)
14641464
sys.exit(1)
14651465

1466+
if self.open_browser:
1467+
# If we're bound to a UNIX socket, we can't reliably connect from a browser.
1468+
self.log.critical(
1469+
_('Options --open-browser and --sock are mutually exclusive. Aborting.'),
1470+
)
1471+
sys.exit(1)
1472+
14661473
if sys.platform.startswith('win'):
14671474
self.log.critical(
14681475
_('Option --sock is not supported on Windows, but got value of %s. Aborting.' % self.sock),
@@ -1935,13 +1942,6 @@ def start(self):
19351942
self.write_server_info_file()
19361943
self.write_browser_open_file()
19371944

1938-
if self.sock and self.open_browser:
1939-
# If we're bound to a UNIX socket, we can't reliably connect from a browser.
1940-
self.log.critical(
1941-
_('Options --open_browser and --sock are mutually exclusive. Aborting.'),
1942-
)
1943-
sys.exit(1)
1944-
19451945
if (self.open_browser or self.file_to_run) and not self.sock:
19461946
self.launch_browser()
19471947

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@
117117
':python_version == "2.7"': ['ipaddress'],
118118
'test:python_version == "2.7"': ['mock'],
119119
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters',
120-
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov',
121-
'requests-unixsocket'],
120+
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov'],
122121
'test:sys_platform == "win32"': ['nose-exclude'],
123122
},
124123
python_requires = '>=3.5',

0 commit comments

Comments
 (0)