@@ -109,19 +109,19 @@ PException constructAndRaiseNoFormatString(VirtualFrame frame, PythonBuiltinClas
109
109
return raiseInternal (frame , type , arguments , keywords , callNode , language , core );
110
110
}
111
111
112
- @ Specialization (guards = {"arguments == null" })
112
+ @ Specialization (guards = {"format != null" , " arguments == null" })
113
113
PException constructAndRaiseNoArgs (VirtualFrame frame , PythonBuiltinClassType type , String format , Object [] formatArgs ,
114
114
@ SuppressWarnings ("unused" ) Object [] arguments , PKeyword [] keywords ,
115
115
@ Cached .Shared ("callNode" ) @ Cached CallVarargsMethodNode callNode ,
116
116
@ Cached .Shared ("pol" ) @ CachedLibrary (limit = "3" ) PythonObjectLibrary pol ,
117
117
@ CachedLanguage PythonLanguage language ,
118
118
@ CachedContext (PythonLanguage .class ) PythonContext context ) {
119
119
PythonCore core = context .getCore ();
120
- Object [] args = new Object []{getFormattedMessage (pol , format , formatArgs )};
120
+ Object [] args = new Object []{formatArgs != null ? getFormattedMessage (pol , format , formatArgs ) : format };
121
121
return raiseInternal (frame , type , args , keywords , callNode , language , core );
122
122
}
123
123
124
- @ Specialization (guards = {"arguments != null" })
124
+ @ Specialization (guards = {"format != null" , " arguments != null" })
125
125
PException constructAndRaise (VirtualFrame frame , PythonBuiltinClassType type , String format , Object [] formatArgs ,
126
126
Object [] arguments , PKeyword [] keywords ,
127
127
@ Cached .Shared ("callNode" ) @ Cached CallVarargsMethodNode callNode ,
0 commit comments