Skip to content

Commit 26877ba

Browse files
committed
check min. python version; os.uname is not available on windows
1 parent 8891ba9 commit 26877ba

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/training/tesstrain.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#
1919
import sys, os, logging
2020

21+
if (sys.version_info.major < 3) or (sys.version_info.major == 3 and sys.version_info.minor < 6):
22+
raise Exception("Must be using Python minimum version 3.6!")
2123

2224
sys.path.insert(0, os.path.dirname(__file__))
2325
from tesstrain_utils import (

src/training/tesstrain_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616

1717
import os
18+
import platform
1819
import sys
1920
from datetime import date
2021
from tempfile import TemporaryDirectory, mkdtemp
@@ -37,7 +38,7 @@
3738

3839
class TrainingArgs(argparse.Namespace):
3940
def __init__(self):
40-
self.uname = os.uname().sysname.lower()
41+
self.uname = platform.uname().system.lower()
4142
self.lang_code = "eng"
4243
self.timestamp = str(date.today())
4344

0 commit comments

Comments
 (0)