changed print to stderr to use warnings module
parent
6754946a80
commit
3d528f85cb
|
@ -13,6 +13,7 @@ __copyright__ = "Copyright © 2022 Nicholas Hope. See LICENSE for details."
|
|||
import sys
|
||||
import os
|
||||
import argparse
|
||||
import warnings
|
||||
from tempfile import NamedTemporaryFile
|
||||
import yaml
|
||||
from platform import system as GetOSName, release as GetOSRelease
|
||||
|
@ -90,13 +91,11 @@ def parseCLI():
|
|||
def getTargetDir(systemName):
|
||||
if systemName == "Darwin":
|
||||
if float( '.'.join( GetOSRelease().split('.')[0:2] ) ) >= 10.15:
|
||||
if not args.force:
|
||||
print(
|
||||
"As of macOS Catalina (v10.15), 32-bit applications "
|
||||
"such as tf2 do not work, so tfscript does not function",
|
||||
file=sys.stderr
|
||||
)
|
||||
else:
|
||||
warnings.warn(
|
||||
"As of macOS Catalina (v10.15), 32-bit applications "
|
||||
"like TF2 do not run. tfscript will run, but you can't run TF2 "
|
||||
"on this system",
|
||||
category=RuntimeWarning )
|
||||
return os.path.expanduser("~/Library/Application Support/Steam/")
|
||||
|
||||
elif systemName == "Windows":
|
||||
|
@ -109,7 +108,7 @@ def getTargetDir(systemName):
|
|||
return os.path.expanduser("~/.local/Steam")
|
||||
|
||||
elif systemName == "Java":
|
||||
print("Java-based OSes are not supported yet by tfscript.", file=sys.stderr)
|
||||
warnings.warn("Java-based OSes are not supported yet by tfscript.", category=RuntimeWarning)
|
||||
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue