aboutsummarylogtreecommitdiffstats
path: root/pythia.patch
blob: b5fbe8de8e508b87c42cc87af3647cb7879b090f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/get_pythia8_version.py
+++ b/get_pythia8_version.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 
 import sys
 import os
@@ -29,17 +29,17 @@
 version = None
 
 def get_version_from_xml():
-    if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')):
-        print( "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n  '%s'\n storing the version number"% \
-               pjoin(local_path,'share','Pythia8','xmldoc','Version.xml'))
-        return None
+    if not os.path.exists(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')):
+         print "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n  '%s'\n storing the version number"% \
+               pjoin(local_path,'share','pythia8','xmldoc','Version.xml')
+         return None
 
     versionfinder = re.compile('^\s*\<parmfix\s*name\=\"Pythia:versionNumber\"\s*default=\"(?P<version>[\d\.]+)\"\>')
 
-    for line in open(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')):
-        match = versionfinder.match(line)
-        if match:
-            version = match.group('version')
+    for line in open(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')):
+         match = versionfinder.match(line)
+         if match:
+             version = match.group('version')
             return version
     return None