@@ -127,7 +127,10 @@ class AbstractPythonIterationsControlVm(AbstractPythonVm):
127127
128128 def __init__ (self , config_name , options = None , iterations = None ):
129129 super (AbstractPythonIterationsControlVm , self ).__init__ (config_name , options )
130- self ._iterations = iterations
130+ try :
131+ self ._iterations = int (iterations )
132+ except Exception :
133+ self ._iterations = None
131134
132135 def _override_iterations_args (self , args ):
133136 _args = []
@@ -142,15 +145,15 @@ def _override_iterations_args(self, args):
142145 return _args
143146
144147 def run (self , cwd , args ):
145- if isinstance ( self ._iterations , ( int , long )) :
148+ if self ._iterations is not None :
146149 args = self ._override_iterations_args (args )
147150 return super (AbstractPythonIterationsControlVm , self ).run (cwd , args )
148151
149152
150153class CPythonVm (AbstractPythonIterationsControlVm ):
151154 PYTHON_INTERPRETER = "python3"
152155
153- def __init__ (self , config_name , options = None , virtualenv = None , iterations = False ):
156+ def __init__ (self , config_name , options = None , virtualenv = None , iterations = None ):
154157 super (CPythonVm , self ).__init__ (config_name , options = options , iterations = iterations )
155158 self ._virtualenv = virtualenv
156159
@@ -167,7 +170,7 @@ def name(self):
167170class PyPyVm (AbstractPythonIterationsControlVm ):
168171 PYPY_INTERPRETER = "pypy3"
169172
170- def __init__ (self , config_name , options = None , iterations = False ):
173+ def __init__ (self , config_name , options = None , iterations = None ):
171174 super (PyPyVm , self ).__init__ (config_name , options = options , iterations = iterations )
172175
173176 @property
0 commit comments