mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
mp debug
This commit is contained in:
parent
2ccb9facd7
commit
2a09349c14
|
@ -5,9 +5,9 @@ import time
|
|||
import threading
|
||||
|
||||
from .__init__ import PY2, WINDOWS
|
||||
from .broker_util import try_exec
|
||||
from .broker_mpw import MpWorker
|
||||
from .util import mp
|
||||
from .broker_util import *
|
||||
|
||||
|
||||
if PY2 and not WINDOWS:
|
||||
|
|
|
@ -7,8 +7,9 @@ import signal
|
|||
import threading
|
||||
|
||||
from .__init__ import PY2, WINDOWS
|
||||
from .broker_util import ExceptionalQueue
|
||||
from .httpsrv import HttpSrv
|
||||
from .broker_util import *
|
||||
from .util import FAKE_MP
|
||||
|
||||
if PY2 and not WINDOWS:
|
||||
import pickle # nosec
|
||||
|
@ -30,7 +31,8 @@ class MpWorker(object):
|
|||
|
||||
# we inherited signal_handler from parent,
|
||||
# replace it with something harmless
|
||||
signal.signal(signal.SIGINT, self.signal_handler)
|
||||
if not FAKE_MP:
|
||||
signal.signal(signal.SIGINT, self.signal_handler)
|
||||
|
||||
# instantiate all services here (TODO: inheritance?)
|
||||
self.httpsrv = HttpSrv(self)
|
||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import print_function, unicode_literals
|
|||
import threading
|
||||
|
||||
from .httpsrv import HttpSrv
|
||||
from .broker_util import *
|
||||
from .broker_util import ExceptionalQueue, try_exec
|
||||
|
||||
|
||||
class BrokerThr(object):
|
||||
|
|
|
@ -9,12 +9,17 @@ import hashlib
|
|||
import threading
|
||||
import subprocess as sp # nosec
|
||||
|
||||
# import multiprocessing.dummy as mp # noqa: F401
|
||||
import multiprocessing as mp # noqa: F401
|
||||
|
||||
from .__init__ import PY2
|
||||
from .stolen import surrogateescape
|
||||
|
||||
FAKE_MP = False
|
||||
|
||||
if FAKE_MP:
|
||||
import multiprocessing.dummy as mp # noqa: F401
|
||||
else:
|
||||
import multiprocessing as mp # noqa: F401
|
||||
|
||||
|
||||
if not PY2:
|
||||
from urllib.parse import unquote_to_bytes as unquote
|
||||
from urllib.parse import quote_from_bytes as quote
|
||||
|
@ -22,7 +27,6 @@ else:
|
|||
from urllib import unquote # pylint: disable=no-name-in-module
|
||||
from urllib import quote # pylint: disable=no-name-in-module
|
||||
|
||||
|
||||
surrogateescape.register_surrogateescape()
|
||||
FS_ENCODING = sys.getfilesystemencoding()
|
||||
|
||||
|
|
Loading…
Reference in a new issue