Skip to content

Commit 104e0c1

Browse files
authored
Merge pull request #240 from davidbrochart/win_py36
Fix python<3.7 on windows
2 parents f1df254 + 9a64b9d commit 104e0c1

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ jobs:
1212
matrix:
1313
os: [ubuntu-latest, macos-latest, windows-latest]
1414
python-version: [ '3.5', '3.6', '3.7', '3.8' ]
15-
exclude:
16-
- os: windows-latest
17-
python-version: '3.5'
18-
- os: windows-latest
19-
python-version: '3.6'
2015
steps:
2116
- name: Checkout
2217
uses: actions/checkout@v1

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ To install the latest release locally, make sure you have
1414

1515
$ pip install jupyter_server
1616

17-
Jupyter Server currently supports the following Python versions:
18-
19-
Platform | Python
20-
--- | ---
21-
Linux | >=3.5
22-
OSX | >=3.5
23-
Windows | >=3.7
17+
Jupyter Server currently supports Python>=3.5 on Linux, OSX and Windows.
2418

2519
### Versioning and Branches
2620

jupyter_server/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""The Jupyter Server"""
22

33
import os
4+
import sys
5+
import subprocess
46

57
DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static")
68
DEFAULT_TEMPLATE_PATH_LIST = [
@@ -11,3 +13,16 @@
1113
del os
1214

1315
from ._version import version_info, __version__
16+
17+
18+
def _cleanup():
19+
pass
20+
21+
22+
# patch subprocess on Windows for python<3.7
23+
# see https://bugs.python.org/issue37380
24+
# the fix for python3.7: https://github.com/python/cpython/pull/15706/files
25+
if sys.platform == 'win32':
26+
if sys.version_info < (3, 7):
27+
subprocess._cleanup = _cleanup
28+
subprocess._active = None

setup.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,10 @@
1919
name = "jupyter_server"
2020

2121
# Minimal Python version sanity check
22-
if sys.platform == 'win32':
23-
if sys.version_info < (3,7):
24-
error = "ERROR: %s requires Python version 3.7 or above." % name
25-
print(error, file=sys.stderr)
26-
sys.exit(1)
27-
else:
28-
if sys.version_info < (3,5):
29-
error = "ERROR: %s requires Python version 3.5 or above." % name
30-
print(error, file=sys.stderr)
31-
sys.exit(1)
22+
if sys.version_info < (3,5):
23+
error = "ERROR: %s requires Python version 3.5 or above." % name
24+
print(error, file=sys.stderr)
25+
sys.exit(1)
3226

3327
# At least we're on the python version we need, move on.
3428

0 commit comments

Comments
 (0)