Skip to content

Commit 1415bca

Browse files
version of testing for pythia version that does not require re module
1 parent f021aa9 commit 1415bca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

smodels/tools/pythia8Wrapper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ def run( self, slhaFile: str, lhefile: Union[str,None]=None,
176176
"""
177177
if "force" in slhaFile:
178178
## there is a bug in pythia8 <= 8316
179-
import re
180-
num = int(''.join(re.findall(r'\d+', self.version)))
179+
num = int(''.join(ch for ch in self.version if ch.isdigit()))
181180
if num <= 8316:
182181
logger.error ( f"the word 'force' appears in your slha file path {slhaFile}, and you are using pythia8 <= 8316. This triggers a pythia bug, consider upgrading pythia8 or avoid paths with 'force' in its name" )
183182
sys.exit()

0 commit comments

Comments
 (0)