@@ -457,6 +457,7 @@ protected static byte[] singleByte() {
457457 @ Specialization
458458 TruffleString resolveName (VirtualFrame frame , TruffleString name , Object globals , int level ,
459459 @ Bind Node inliningTarget ,
460+ @ Cached PConstructAndRaiseNode constructAndRaiseNode ,
460461 @ Cached GetDictFromGlobalsNode getDictNode ,
461462 @ Cached PyDictGetItem getPackageOrNameNode ,
462463 @ Cached PyDictGetItem getSpecNode ,
@@ -549,15 +550,15 @@ TruffleString resolveName(VirtualFrame frame, TruffleString name, Object globals
549550 if (path == null ) {
550551 int dotIdx = indexOfCodePointNode .execute (pkgString , '.' , 0 , codePointLengthNode .execute (pkgString , TS_ENCODING ), TS_ENCODING );
551552 if (dotIdx < 0 ) {
552- throw noParentError (frame );
553+ throw noParentError (frame , constructAndRaiseNode );
553554 }
554555 pkgString = substringNode .execute (pkgString , 0 , dotIdx , TS_ENCODING , true );
555556 }
556557 }
557558
558559 int lastDotIdx = codePointLengthNode .execute (pkgString , TS_ENCODING );
559560 if (lastDotIdx == 0 ) {
560- throw noParentError (frame );
561+ throw noParentError (frame , constructAndRaiseNode );
561562 }
562563
563564 for (int levelUp = 1 ; levelUp < level ; levelUp += 1 ) {
@@ -579,8 +580,8 @@ TruffleString resolveName(VirtualFrame frame, TruffleString name, Object globals
579580 return toStringNode .execute (sb );
580581 }
581582
582- private static RuntimeException noParentError (VirtualFrame frame ) {
583- throw PConstructAndRaiseNode . getUncached () .raiseImportError (frame , ATTEMPTED_RELATIVE_IMPORT_BEYOND_TOPLEVEL );
583+ private static RuntimeException noParentError (VirtualFrame frame , PConstructAndRaiseNode raiseNode ) {
584+ throw raiseNode .raiseImportError (frame , ATTEMPTED_RELATIVE_IMPORT_BEYOND_TOPLEVEL );
584585 }
585586 }
586587
0 commit comments