Solve problem with subprocess.call() on windows:

- uncomment console_scripts (only for windows) to get exe
 - replace call() with Popen() to avoid blocking
This commit is contained in:
Dmitri Bogomolov 2020-02-20 14:14:25 +02:00
parent 80831754b3
commit affdb2fdc0
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@
import os import os
import shutil import shutil
import sys
from setuptools import setup, Extension from setuptools import setup, Extension
from setuptools.command.install import install from setuptools.command.install import install
@ -146,9 +147,9 @@ if __name__ == "__main__":
'bitmessage.proxyconfig': [ 'bitmessage.proxyconfig': [
'stem = pybitmessage.plugins.proxyconfig_stem [tor]' 'stem = pybitmessage.plugins.proxyconfig_stem [tor]'
], ],
# 'console_scripts': [ 'console_scripts': [
# 'pybitmessage = pybitmessage.bitmessagemain:main' 'pybitmessage = pybitmessage.bitmessagemain:main'
# ] ] if sys.platform[:3] == 'win' else []
}, },
scripts=['src/pybitmessage'], scripts=['src/pybitmessage'],
cmdclass={'install': InstallCmd}, cmdclass={'install': InstallCmd},

View File

@ -35,7 +35,9 @@ class TestProcessProto(unittest.TestCase):
cls.flag = False cls.flag = False
cls.home = os.environ['BITMESSAGE_HOME'] = tempfile.gettempdir() cls.home = os.environ['BITMESSAGE_HOME'] = tempfile.gettempdir()
put_signal_file(cls.home, 'unittest.lock') put_signal_file(cls.home, 'unittest.lock')
subprocess.call(cls._process_cmd) # nosec subprocess.Popen(
cls._process_cmd,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # nosec
time.sleep(5) time.sleep(5)
try: try:
cls.pid = int(cls._get_readline('singleton.lock')) cls.pid = int(cls._get_readline('singleton.lock'))