diff --git a/.jenkins/check/config/filter_pylint.txt b/.jenkins/check/config/filter_pylint.txt index 940d2f291e6..434c593e9ae 100644 --- a/.jenkins/check/config/filter_pylint.txt +++ b/.jenkins/check/config/filter_pylint.txt @@ -208,6 +208,7 @@ "mindspore/tests/st/ops/dynamic_shape/" "relative-beyond-top-level" "mindspore/tests/st/ops/dynamic_shape/" "too-many-arguments" "mindspore/tests/st/ops/dynamic_shape/" "too-many-locals" +"mindspore/tests/ut/python/graph_syntax/test_invalid_attribute.py" "misplaced-bare-raise" #MindSpore Lite "mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/generator.py" "redefined-builtin" diff --git a/mindspore/ccsrc/pipeline/jit/ps/pass.cc b/mindspore/ccsrc/pipeline/jit/ps/pass.cc index 993ec90f4d7..9545e1482a7 100644 --- a/mindspore/ccsrc/pipeline/jit/ps/pass.cc +++ b/mindspore/ccsrc/pipeline/jit/ps/pass.cc @@ -995,7 +995,7 @@ bool AddEmbeddingCachePass(const ResourcePtr &resource) { std::vector kVmPasses = {{"py_interpret_to_execute", PyInterpretToExecutePass}, {"rewriter_before_opt_a", RewriterBeforeOptAPass}, {"opt_a", OptPassAGroup}, - {"py_interpret_to_execute", PyInterpretToExecutePass}, + {"py_interpret_to_execute_after_opt_a", PyInterpretToExecutePass}, {"slice_cell_reuse_recomputed_activation", SliceReuseRecomputedActivationPass}, {"rewriter_after_opt_a", RewriterAfterOptAPass}, {"convert_pyexecute_list_input", ConvertPyExecuteListInputPass}, diff --git a/mindspore/ccsrc/pipeline/jit/ps/static_analysis/prim.cc b/mindspore/ccsrc/pipeline/jit/ps/static_analysis/prim.cc index c6e838965bc..0da5beabeba 100644 --- a/mindspore/ccsrc/pipeline/jit/ps/static_analysis/prim.cc +++ b/mindspore/ccsrc/pipeline/jit/ps/static_analysis/prim.cc @@ -2997,7 +2997,7 @@ class RaiseEvaluator : public TransitionPrimEvaluator { MS_EXCEPTION_IF_NULL(cur_graph); if (args_abs_list.empty()) { // Process raise. - MS_LOG(INTERNAL_EXCEPTION) << "No active exception to re-raise."; + MS_LOG(INTERNAL_EXCEPTION) << "No active exception to reraise."; } const auto &cnode = node->cast(); MS_EXCEPTION_IF_NULL(cnode); diff --git a/tests/ut/python/graph_syntax/test_invalid_attribute.py b/tests/ut/python/graph_syntax/test_invalid_attribute.py index e9c10f86a4a..dafa53845ef 100644 --- a/tests/ut/python/graph_syntax/test_invalid_attribute.py +++ b/tests/ut/python/graph_syntax/test_invalid_attribute.py @@ -145,3 +145,22 @@ def test_create_multitype_funcgraph_instance(): x = Tensor([1]) net = Net() net(x) + + +def test_raise_empty(): + """ + Feature: test raise error use + Description: raise error use. + Expectation: RuntimeError No active exception to reraise. + """ + + class Net(nn.Cell): + def construct(self, x): + if x == 1: + raise + return x + + with pytest.raises(RuntimeError) as e: + net = Net() + net(1) + assert "No active exception to reraise" in str(e.value)