Skip to content

Commit d93a9b1

Browse files
committed
Yet one another Python 2 compatibility fix
1 parent c663b97 commit d93a9b1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OMPython/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,10 +1326,11 @@ def simulate(self,resultfile=None,simflags=None,overrideaux=None): # 11
13261326
# print(str(cmd))
13271327
try: # Python 3
13281328
p = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
1329+
out = p.stdout # .read()
13291330
except: # Python 2
1330-
p = subprocess.call(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
1331+
os.system(cmd)
1332+
out = ''
13311333
# p = subprocess.run([getExeFile, r], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
1332-
out = p.stdout # .read()
13331334
self.simulationFlag = True
13341335
if self.xmlFileName is not None:
13351336
os.chdir(cwd_current)

0 commit comments

Comments
 (0)