diff --git a/copyparty/__init__.py b/copyparty/__init__.py index 7eb133e2..f2fc0fe7 100644 --- a/copyparty/__init__.py +++ b/copyparty/__init__.py @@ -16,6 +16,8 @@ if platform.system() == "Windows": VT100 = not WINDOWS or WINDOWS >= [10, 0, 14393] # introduced in anniversary update +MACOS = platform.system() == "Darwin" + class EnvParams(object): def __init__(self): diff --git a/copyparty/svchub.py b/copyparty/svchub.py index b3c3153a..dbf63fd7 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -8,7 +8,7 @@ import threading from datetime import datetime, timedelta import calendar -from .__init__ import PY2, WINDOWS, VT100 +from .__init__ import PY2, WINDOWS, MACOS, VT100 from .tcpsrv import TcpSrv from .up2k import Up2k from .util import mp @@ -111,6 +111,8 @@ class SvcHub(object): return msg elif vmin < 3: return msg + elif MACOS: + return "multiprocessing is wonky on mac osx;" else: msg = "need python 2.7 or 3.3+ for multiprocessing;" if not PY2 and vmin < 3: @@ -133,7 +135,7 @@ class SvcHub(object): if mp.cpu_count() <= 1: return False - + try: # support vscode debugger (bonus: same behavior as on windows) mp.set_start_method("spawn", True) diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index 64e02789..63a922c3 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -24,6 +24,7 @@ command -v gfind >/dev/null && { sed() { gsed "$@"; } find() { gfind "$@"; } sort() { gsort "$@"; } + unexpand() { gunexpand "$@"; } } [ -e copyparty/__main__.py ] || cd .. @@ -71,7 +72,15 @@ cd sfx tar -zxf $f mv Jinja2-*/jinja2 . - rm -rf Jinja2-* jinja2/testsuite jinja2/tests.py + rm -rf Jinja2-* jinja2/testsuite jinja2/_markupsafe/tests.py jinja2/_stringdefs.py + + f=jinja2/lexer.py + sed -r '/.*föö.*/ raise SyntaxError/' <$f >t + tmv $f + + f=jinja2/_markupsafe/_constants.py + awk '!/: [0-9]+,?$/ || /(amp|gt|lt|quot|apos|nbsp).:/' <$f >t + tmv $f # msys2 tar is bad, make the best of it echo collecting source