mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore multiprocessing test on macOS
Needed to make the temp dir path shorter
This commit is contained in:
parent
2081decec5
commit
55a8499995
@ -7,19 +7,10 @@ being closed.
|
|||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from calibre.constants import __appname__, __version__, filesystem_encoding, get_windows_temp_path, ismacos, iswindows
|
from calibre.constants import __appname__, filesystem_encoding, get_windows_temp_path, ismacos, iswindows
|
||||||
from calibre.utils.safe_atexit import remove_dir, remove_file_atexit, remove_folder_atexit, unlink
|
from calibre.utils.safe_atexit import remove_dir, remove_file_atexit, remove_folder_atexit, unlink
|
||||||
|
|
||||||
_base_dir = None
|
_base_dir = _osx_cache_dir = None
|
||||||
|
|
||||||
|
|
||||||
def app_prefix(prefix):
|
|
||||||
if iswindows:
|
|
||||||
return f'{__appname__}_'
|
|
||||||
return f'{__appname__}_{__version__}_{prefix}'
|
|
||||||
|
|
||||||
|
|
||||||
_osx_cache_dir = None
|
|
||||||
|
|
||||||
|
|
||||||
def osx_cache_dir():
|
def osx_cache_dir():
|
||||||
@ -66,7 +57,7 @@ def base_dir():
|
|||||||
base = os.environ.get('CALIBRE_TEMP_DIR', None)
|
base = os.environ.get('CALIBRE_TEMP_DIR', None)
|
||||||
if base is not None and iswindows:
|
if base is not None and iswindows:
|
||||||
base = os.getenv('CALIBRE_TEMP_DIR')
|
base = os.getenv('CALIBRE_TEMP_DIR')
|
||||||
prefix = app_prefix('tmp_')
|
prefix = f'{__appname__}-'
|
||||||
if base is None:
|
if base is None:
|
||||||
if iswindows:
|
if iswindows:
|
||||||
# On windows, if the TMP env var points to a path that
|
# On windows, if the TMP env var points to a path that
|
||||||
|
@ -556,10 +556,6 @@ class BuildTest(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
def test_multiprocessing():
|
def test_multiprocessing():
|
||||||
if ismacos:
|
|
||||||
# skip because this tests fails on some macOS systems with
|
|
||||||
# OSError: AF_UNIX path too long. Sigh.
|
|
||||||
return
|
|
||||||
from multiprocessing import get_all_start_methods, get_context
|
from multiprocessing import get_all_start_methods, get_context
|
||||||
for stype in get_all_start_methods():
|
for stype in get_all_start_methods():
|
||||||
if stype == 'fork':
|
if stype == 'fork':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user