(self, path)
| 397 | |
| 398 | # PEP-302 extension 1 of 3: data loader. |
| 399 | def get_data(self, path): |
| 400 | # XXX |
| 401 | # Python machinery operates on absolute paths and uses this method to load bytecode. |
| 402 | # That's why we don't try to resolve the path, but try to read it right away. |
| 403 | # For more info see get_code() in this file and |
| 404 | # data flow in SourceLoader.get_data in contrib/tools/python3/Lib/importlib/_bootstrap_external.py |
| 405 | if EXTERNAL_PY_FILES_MODE and path.endswith('.pyc'): |
| 406 | return file_bytes(_b(path)) |
| 407 | |
| 408 | path = _b(path) |
| 409 | abspath = resfs_resolve(path) |
| 410 | |
| 411 | if abspath: |
| 412 | return file_bytes(abspath) |
| 413 | |
| 414 | path = path.replace(_b('\\'), _b('/')) |
| 415 | data = resfs_read(path, builtin=True) |
| 416 | if data is None: |
| 417 | raise OSError(path) # Y_PYTHON_ENTRY_POINT=:resource_files |
| 418 | return data |
| 419 | |
| 420 | # PEP-302 extension 2 of 3: get __file__ without importing. |
| 421 | def get_filename(self, fullname): |
no test coverage detected