Skip to content

Commit 25990c5

Browse files
committed
__init__.py: Use logger to raise error on Windows rather than print
1 parent 36c04d1 commit 25990c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

schema_salad/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
import os
44
import sys
55
import typing
6+
7+
import six
8+
69
from .utils import onWindows
710
__author__ = '[email protected]'
811

912
_logger = logging.getLogger("salad")
1013
_logger.addHandler(logging.StreamHandler())
1114
_logger.setLevel(logging.INFO)
1215

13-
import six
1416
if six.PY3:
1517

1618
if onWindows:
@@ -20,8 +22,9 @@
2022
try:
2123
os.makedirs("/tmp")
2224
except OSError as exception:
23-
print("Cannot create '\\tmp' folder needed for",
24-
"'cwltool' Python 3 installation.")
25+
_logger.error(u"Cannot create '\\tmp' folder in root needed for",
26+
"'cwltool' Python 3 installation.")
27+
exit(1)
2528

2629
from past import autotranslate # type: ignore
2730
autotranslate(['avro', 'avro.schema'])

0 commit comments

Comments
 (0)