44 */
55package org .python .core ;
66
7- import org .python .modules ._systemrestart ;
87import com .google .common .base .CharMatcher ;
98
109public abstract class PyBaseCode extends PyCode {
@@ -103,21 +102,16 @@ public PyObject call(ThreadState ts, PyFrame frame, PyObject closure) {
103102 ts .exception = previous_exception ;
104103
105104 ts .frame = ts .frame .f_back ;
106-
107- // Check for interruption, which is used for restarting the interpreter
108- // on Jython
109- if (ts .getSystemState ()._systemRestart && Thread .currentThread ().isInterrupted ()) {
110- throw new PyException (_systemrestart .SystemRestart );
111- }
112105 return ret ;
113106 }
114107
115108 public PyObject call (ThreadState state , PyObject globals , PyObject [] defaults ,
116109 PyObject closure )
117110 {
118- if (co_argcount != 0 || varargs || varkwargs )
111+ if (co_argcount != 0 || varargs || varkwargs ) {
119112 return call (state , Py .EmptyObjects , Py .NoKeywords , globals , defaults ,
120113 closure );
114+ }
121115 PyFrame frame = new PyFrame (this , globals );
122116 if (co_flags .isFlagSet (CodeFlag .CO_GENERATOR )) {
123117 return new PyGenerator (frame , closure );
@@ -128,9 +122,10 @@ public PyObject call(ThreadState state, PyObject globals, PyObject[] defaults,
128122 public PyObject call (ThreadState state , PyObject arg1 , PyObject globals , PyObject [] defaults ,
129123 PyObject closure )
130124 {
131- if (co_argcount != 1 || varargs || varkwargs )
125+ if (co_argcount != 1 || varargs || varkwargs ) {
132126 return call (state , new PyObject [] {arg1 },
133127 Py .NoKeywords , globals , defaults , closure );
128+ }
134129 PyFrame frame = new PyFrame (this , globals );
135130 frame .f_fastlocals [0 ] = arg1 ;
136131 if (co_flags .isFlagSet (CodeFlag .CO_GENERATOR )) {
@@ -142,9 +137,10 @@ public PyObject call(ThreadState state, PyObject arg1, PyObject globals, PyObjec
142137 public PyObject call (ThreadState state , PyObject arg1 , PyObject arg2 , PyObject globals ,
143138 PyObject [] defaults , PyObject closure )
144139 {
145- if (co_argcount != 2 || varargs || varkwargs )
140+ if (co_argcount != 2 || varargs || varkwargs ) {
146141 return call (state , new PyObject [] {arg1 , arg2 },
147142 Py .NoKeywords , globals , defaults , closure );
143+ }
148144 PyFrame frame = new PyFrame (this , globals );
149145 frame .f_fastlocals [0 ] = arg1 ;
150146 frame .f_fastlocals [1 ] = arg2 ;
@@ -158,9 +154,10 @@ public PyObject call(ThreadState state, PyObject arg1, PyObject arg2, PyObject a
158154 PyObject globals , PyObject [] defaults ,
159155 PyObject closure )
160156 {
161- if (co_argcount != 3 || varargs || varkwargs )
157+ if (co_argcount != 3 || varargs || varkwargs ) {
162158 return call (state , new PyObject [] {arg1 , arg2 , arg3 },
163159 Py .NoKeywords , globals , defaults , closure );
160+ }
164161 PyFrame frame = new PyFrame (this , globals );
165162 frame .f_fastlocals [0 ] = arg1 ;
166163 frame .f_fastlocals [1 ] = arg2 ;
@@ -175,9 +172,10 @@ public PyObject call(ThreadState state, PyObject arg1, PyObject arg2, PyObject a
175172 public PyObject call (ThreadState state , PyObject arg1 , PyObject arg2 ,
176173 PyObject arg3 , PyObject arg4 , PyObject globals ,
177174 PyObject [] defaults , PyObject closure ) {
178- if (co_argcount != 4 || varargs || varkwargs )
175+ if (co_argcount != 4 || varargs || varkwargs ) {
179176 return call (state , new PyObject []{arg1 , arg2 , arg3 , arg4 },
180177 Py .NoKeywords , globals , defaults , closure );
178+ }
181179 PyFrame frame = new PyFrame (this , globals );
182180 frame .f_fastlocals [0 ] = arg1 ;
183181 frame .f_fastlocals [1 ] = arg2 ;
0 commit comments