Skip to content

Commit 3bf12ec

Browse files
committed
Another round of fixing logic, LOG.info() that we are using binary directly
1 parent a858c74 commit 3bf12ec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/Python/mcrun/mccode.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,21 @@ def x_path(file):
128128
''' Return external path (relative to self.path) for file '''
129129
return '%s/%s' % (dirname(self.path), basename(file))
130130

131-
# Copy instrument file to cwd if not already there (for compatibility)
132-
if not isfile(basename(self.path)):
133-
shutil.copy2(self.path, ".") # also copies stat information
134-
135131
# Create the path for the binary
136132
if os.name == 'nt':
137133
self.binpath = '%s.%s' % (self.name, mccode_config.platform['EXESUFFIX'])
138134
else:
139135
self.binpath = './%s.%s' % (self.name, mccode_config.platform['EXESUFFIX'])
140136

141137
# Check if self.path is .exe or .out binary, if so - skip ahead to execution
142-
if pathlib.Path(self.path).suffix==mccode_config.platform['EXESUFFIX']:
138+
if self.path==basename(self.binpath):
139+
LOG.info('Called with binary file %s, skipping ahead to execution', self.binpath)
143140
return
144141

142+
# Copy instrument file to cwd if not already there (for compatibility)
143+
if not isfile(basename(self.path)):
144+
shutil.copy2(self.path, ".") # also copies stat information
145+
145146
# Check if c-code should be regenerated by comparing to instr timestamp
146147
existingC = findReusableFile(self.path,
147148
[self.cpath, x_path(self.cpath)])

0 commit comments

Comments
 (0)