Skip to content

Commit ab6bb7e

Browse files
committed
[cmd/main] perform python version checks
1 parent f2c0cd6 commit ab6bb7e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

nixio/cmd/main.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
annotations.
88
nixio upgrade: Update older files to the newest file format.
99
"""
10+
import sys
1011
import argparse
1112
from . import explore, validate, upgrade
1213

@@ -15,9 +16,13 @@ def main():
1516
parser = argparse.ArgumentParser(
1617
description="Command line interface for nixio tools"
1718
)
18-
19-
subcmds = parser.add_subparsers(title="commands", required=True,
20-
dest="cmd")
19+
if sys.version_info.major < 3 or sys.version_info.minor < 6:
20+
raise RuntimeError("nixio does not support python versions less than 3.6!")
21+
if sys.version_info.minor < 7:
22+
subcmds = parser.add_subparsers(title="commands", dest="cmd")
23+
else:
24+
subcmds = parser.add_subparsers(title="commands", required=True,
25+
dest="cmd")
2126

2227
# nixio explore
2328
explore_cmd = subcmds.add_parser("explore", help=explore.__doc__)

0 commit comments

Comments
 (0)