19 Commits

Author SHA1 Message Date
Shahar Naveh
a781980d9b Update importlib to 3.14.5 (#8013) 2026-06-02 18:06:36 +09:00
Jeong, YunWon
470bd5990b Fix test_import: import machinery, circular imports, and script shadowing (#7034)
* Fix test_import: import machinery and errors

- Emit IMPORT_FROM instead of LOAD_ATTR for `import a.b.c as m`
- Add "partially initialized module" error for circular imports
- Add "cannot access submodule" error for initializing submodules
- Implement script shadowing detection with "consider renaming" hint
  - Detect user scripts shadowing stdlib/third-party modules
  - Compute original sys.path[0] from sys.argv[0]
  - Check sys.stdlib_module_names for stdlib detection
  - Respect safe_path setting
- Implement _imp._fix_co_filename for code source_path rewriting
- Add data parameter to _imp.get_frozen_object with marshal deser
- Fix import_from: check __spec__.has_location before using origin
- Set ImportError.path attribute on import failures
- Fix import_star error messages for non-str __all__/__dict__ items
- Always call builtins.__import__ in import_inner

* Propagate __bool__ errors from fromlist in import

Previously, try_to_bool errors were silently swallowed via .ok(),
causing fromlist with broken __bool__ to default to false.
2026-02-09 01:40:26 +09:00
CPython Developers
afdf8cefe8 Update importlib from v3.14.2 2026-02-05 00:21:34 +09:00
Jeong, YunWon
af884cb284 First step for Python 3.12 support (#5078)
* Mark 3.12

* Update importlib from Python 3.12.0

* Update test_importlib from Python3.12

* Mark failings tests from importlib

* Update test.support from Python3.12

* Fix unsupported parser feature

* mark failing test

* Update functools from Python 3.12

* manual type annotation

* slice behavior changed in 3.12

* empty unittest.main returns non-zero

* test_decimal from CPython 3.12

* Mark failing tests

* Update test_unicode from CPython 3.12

* Update test_functools from Python 3.12

* Update enum from Python 3.12

* enum

* Doc format changed

* Update test_module from CPython

---------

Co-authored-by: CPython developers <>
2023-10-22 19:19:05 -07:00
CPython Developers
496006d629 Update importlib from CPython 3.11.2 2023-02-25 22:59:57 +09:00
Jeong YunWon
47dbafe7d3 @writes_bytecode_files to skip
https://github.com/python/cpython/pull/95972
2022-08-18 03:22:20 +09:00
CPython Developers
da109336bb Update importlib/test_importlib from CPython 3.10.6 2022-08-18 03:22:20 +09:00
Dean Li
6f98288e84 test: use import_helper 2021-11-29 21:03:02 +08:00
Dean Li
5ee4fb899b test: use os_helper 2021-11-28 20:51:32 +08:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Dean Li
49a5805d11 test: use os_helper 2021-11-13 02:18:33 +00:00
Padraic Fanning
4370147bbe Unskip test_resource_path 2021-02-07 15:49:42 -05:00
Padraic Fanning
ee78b87159 Unskip test_resource_opener 2021-02-07 15:49:42 -05:00
Padraic Fanning
1c9b36c781 Unskip test_importing_module_as_side_effect 2021-02-07 15:49:42 -05:00
Padraic Fanning
c185a387de Unskip test_string_path 2021-02-07 15:49:42 -05:00
Padraic Fanning
76e230a470 Unskip test_package_object 2021-02-07 15:49:42 -05:00
Padraic Fanning
3296aa5112 Unskip test_package_name 2021-02-07 15:49:42 -05:00
Aviv Palivoda
f039959480 Mark unsupported py_compile tests 2020-07-18 17:04:35 +03:00
Aviv Palivoda
e6d413b30b Add test_importlib from CPython 3.8 2020-07-18 17:04:35 +03:00