Skip to content

Commit

Permalink
🐛 Raise SystemExit when port-forwarding is enabled and local port is …
Browse files Browse the repository at this point in the history
…not available (#48)
  • Loading branch information
andersy005 authored Nov 5, 2020
1 parent aa27703 commit e2587aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- 🐛 Raise SystemExit when port-forwarding is enabled and local port is not available. PR [#48](https://github.com/NCAR/jupyter-forward/pull/48) by [@andersy005](https://github.com/andersy005)

## v2020.10.27

- ⚡ Use try block to exit gracefully. PR [#45](https://github.com/NCAR/jupyter-forward/pull/45) by [@andersy005](https://github.com/andersy005)
Expand Down
2 changes: 1 addition & 1 deletion jupyter_forward/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RemoteRunner:
shell: str = '/usr/bin/env bash'

def __post_init__(self):
if not is_port_available(self.port):
if self.port_forwarding and not is_port_available(self.port):
raise SystemExit(
(
f'''Specified port={self.port} is already in use on your local machine. Try a different port'''
Expand Down

0 comments on commit e2587aa

Please sign in to comment.