@classmethod
def setUpClass(cls):
    for path in filter(os.path.isdir, sys.path):
        directory_created = False
        directory = (pathlib.Path(path) / '__pycache__')
        path = (directory / 'test.try')
        try:
            if (not directory.is_dir()):
                directory.mkdir()
                directory_created = True
            with path.open('w') as file:
                file.write('# for test_compileall')
        except OSError:
            sys_path_writable = False
            break
        finally:
            support.unlink(str(path))
            if directory_created:
                directory.rmdir()
    else:
        sys_path_writable = True
    cls._sys_path_writable = sys_path_writable
@classmethod
def setUpClass(cls):
    for path in filter(os.path.isdir, sys.path):
        directory_created = False
        directory = (pathlib.Path(path) / '__pycache__')
        path = (directory / 'test.try')
        try:
            if (not directory.is_dir()):
                directory.mkdir()
                directory_created = True
            with path.open('w') as file:
                file.write('# for test_compileall')
        except OSError:
            sys_path_writable = False
            break
        finally:
            support.unlink(str(path))
            if directory_created:
                directory.rmdir()
    else:
        sys_path_writable = True
    cls._sys_path_writable = sys_path_writable