@@ -127,7 +127,10 @@ class AbstractPythonIterationsControlVm(AbstractPythonVm):
127
127
128
128
def __init__ (self , config_name , options = None , iterations = None ):
129
129
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
131
134
132
135
def _override_iterations_args (self , args ):
133
136
_args = []
@@ -142,15 +145,15 @@ def _override_iterations_args(self, args):
142
145
return _args
143
146
144
147
def run (self , cwd , args ):
145
- if isinstance ( self ._iterations , ( int , long )) :
148
+ if self ._iterations is not None :
146
149
args = self ._override_iterations_args (args )
147
150
return super (AbstractPythonIterationsControlVm , self ).run (cwd , args )
148
151
149
152
150
153
class CPythonVm (AbstractPythonIterationsControlVm ):
151
154
PYTHON_INTERPRETER = "python3"
152
155
153
- def __init__ (self , config_name , options = None , virtualenv = None , iterations = False ):
156
+ def __init__ (self , config_name , options = None , virtualenv = None , iterations = None ):
154
157
super (CPythonVm , self ).__init__ (config_name , options = options , iterations = iterations )
155
158
self ._virtualenv = virtualenv
156
159
@@ -167,7 +170,7 @@ def name(self):
167
170
class PyPyVm (AbstractPythonIterationsControlVm ):
168
171
PYPY_INTERPRETER = "pypy3"
169
172
170
- def __init__ (self , config_name , options = None , iterations = False ):
173
+ def __init__ (self , config_name , options = None , iterations = None ):
171
174
super (PyPyVm , self ).__init__ (config_name , options = options , iterations = iterations )
172
175
173
176
@property
0 commit comments