mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Fix ImportError fields (#6079)
This commit is contained in:
6
Lib/importlib/metadata/__init__.py
vendored
6
Lib/importlib/metadata/__init__.py
vendored
@@ -56,12 +56,6 @@ class PackageNotFoundError(ModuleNotFoundError):
|
||||
(name,) = self.args
|
||||
return name
|
||||
|
||||
# TODO: RUSTPYTHON; the entire setter is added to avoid errors
|
||||
@name.setter
|
||||
def name(self, value):
|
||||
import sys
|
||||
sys.stderr.write("set value to PackageNotFoundError ignored\n")
|
||||
|
||||
|
||||
class Sectioned:
|
||||
"""
|
||||
|
||||
@@ -923,8 +923,6 @@ impl ExceptionZoo {
|
||||
|
||||
extend_exception!(PyImportError, ctx, excs.import_error, {
|
||||
"msg" => ctx.new_readonly_getset("msg", excs.import_error, make_arg_getter(0)),
|
||||
"name" => ctx.none(),
|
||||
"path" => ctx.none(),
|
||||
});
|
||||
extend_exception!(PyModuleNotFoundError, ctx, excs.module_not_found_error);
|
||||
|
||||
@@ -1364,8 +1362,9 @@ pub(super) mod types {
|
||||
)));
|
||||
}
|
||||
|
||||
zelf.set_attr("name", vm.unwrap_or_none(name), vm)?;
|
||||
zelf.set_attr("path", vm.unwrap_or_none(path), vm)?;
|
||||
let dict = zelf.dict().unwrap();
|
||||
dict.set_item("name", vm.unwrap_or_none(name), vm)?;
|
||||
dict.set_item("path", vm.unwrap_or_none(path), vm)?;
|
||||
PyBaseException::slot_init(zelf, args, vm)
|
||||
}
|
||||
#[pymethod]
|
||||
|
||||
Reference in New Issue
Block a user