diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index f00ba96ff..fe3a183e7 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -201,9 +201,9 @@ def create_tarfile(env, compression_level='9'): try: shutil.rmtree(base) except OSError as err: - if err.errno != errno.ENOENT: + if err.errno not in (errno.ENOENT, errno.EBUSY): # EBUSY when the directory is mountpoint raise - os.mkdir(base) + os.makedirs(base, exist_ok=True) dist = os.path.join(base, f'{kitty_constants["appname"]}-{kitty_constants["version"]}-{arch}.tar') with tarfile.open(dist, mode='w', format=tarfile.PAX_FORMAT) as tf: cwd = os.getcwd() diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 7233cab8a..b60a50324 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -306,6 +306,7 @@ def __init__( if argv is None: from kitty.child import openpty self.master_fd, self.slave_fd = openpty() + self.child_pid = 0 else: self.child_pid, self.master_fd = fork() self.is_child = self.child_pid == CHILD