()
| 173 | |
| 174 | |
| 175 | def can_symlink(): |
| 176 | global _can_symlink |
| 177 | if _can_symlink is not None: |
| 178 | return _can_symlink |
| 179 | # WASI / wasmtime prevents symlinks with absolute paths, see man |
| 180 | # openat2(2) RESOLVE_BENEATH. Almost all symlink tests use absolute |
| 181 | # paths. Skip symlink tests on WASI for now. |
| 182 | src = os.path.abspath(TESTFN) |
| 183 | symlink_path = src + "can_symlink" |
| 184 | try: |
| 185 | os.symlink(src, symlink_path) |
| 186 | can = True |
| 187 | except (OSError, NotImplementedError, AttributeError): |
| 188 | can = False |
| 189 | else: |
| 190 | os.remove(symlink_path) |
| 191 | _can_symlink = can |
| 192 | return can |
| 193 | |
| 194 | |
| 195 | def skip_unless_symlink(test): |
searching dependent graphs…