Skip to content

Commit cd4cac0

Browse files
committed
Merge branch 'version_check' of https://github.com/Axe319/vpython-jupyter into version_check
2 parents 405062d + 426eeae commit cd4cac0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

vpython/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
# both of those.
1111

1212
from ._notebook_helpers import _isnotebook, __is_spyder
13-
import platform
14-
__p = platform.python_version()
13+
import sys
14+
__v = sys.version_info
1515

16-
# Delete platform now that we are done with it
17-
del platform
16+
# Delete sys now that we are done with it
17+
del sys
1818

19-
__ispython3 = (__p[0] == '3')
20-
__require_notebook = (not __ispython3) or (__p[2] < '5') # Python 2.7 or 3.4 require Jupyter notebook
19+
__ispython3 = (__v.major == 3)
20+
__require_notebook = (not __ispython3) or (__v.minor < 5) # Python 2.7 or 3.4 require Jupyter notebook
2121

2222
if __require_notebook and (not _isnotebook):
2323
s = "The non-notebook version of vpython requires Python 3.5 or later."

0 commit comments

Comments
 (0)