Commit a9dfb5f5b9a092ff3d5a23188e5d4f4fcb384840

Authored by Jürgen Knödlseder
1 parent bec1b15e

Adjuste code so that it compiles on all Python versions

cscripts/Makefile.am
@@ -241,7 +241,7 @@ uninstall-hook: @@ -241,7 +241,7 @@ uninstall-hook:
241 241
242 # Files to be removed in build directory 242 # Files to be removed in build directory
243 clean-local: 243 clean-local:
244 - @if test '@srcdir@' != '@builddir@'; then \ 244 + @if test '@top_srcdir@' != '@top_builddir@'; then \
245 rm -rf $(top_builddir)/cscripts/cs*.py; \ 245 rm -rf $(top_builddir)/cscripts/cs*.py; \
246 rm -rf $(top_builddir)/cscripts/obsutils.py; \ 246 rm -rf $(top_builddir)/cscripts/obsutils.py; \
247 rm -rf $(top_builddir)/cscripts/modutils.py; \ 247 rm -rf $(top_builddir)/cscripts/modutils.py; \
cscripts/cstsmapsplit.py
@@ -286,9 +286,7 @@ class cstsmapsplit(ctools.cscript): @@ -286,9 +286,7 @@ class cstsmapsplit(ctools.cscript):
286 f.close() 286 f.close()
287 287
288 # Make file executable 288 # Make file executable
289 - mode = os.stat(filename).st_mode  
290 - mode |= (mode & 0o444) >> 2 # copy R bits to X  
291 - os.chmod(filename, mode) 289 + os.system('chmod +x %s' % filename)
292 290
293 # Return 291 # Return
294 return 292 return
doc/source/users/tutorials/1dc/howto_tsmap.rst
@@ -77,7 +77,7 @@ The figure below shows the resulting Test Statistic map. @@ -77,7 +77,7 @@ The figure below shows the resulting Test Statistic map.
77 Size of the Y axis in pixels [200] 10 77 Size of the Y axis in pixels [200] 10
78 Test source name [Crab] Src001 78 Test source name [Crab] Src001
79 Output Test Statistic map file [tsmap.fits] tsmap_split.fits 79 Output Test Statistic map file [tsmap.fits] tsmap_split.fits
80 - Number of TS map bins per task [5] 80 + Number of TS map bins per task [5] 10
81 Compute null hypothesis first? [yes] 81 Compute null hypothesis first? [yes]
82 ASCII file containing all commands [commands.dat] tsmap_commands.dat 82 ASCII file containing all commands [commands.dat] tsmap_commands.dat
83 83
pyext/setup.py.in
@@ -141,8 +141,8 @@ if is_build: @@ -141,8 +141,8 @@ if is_build:
141 if '@BUILD_WRAPPERS_FALSE@' != '#': 141 if '@BUILD_WRAPPERS_FALSE@' != '#':
142 py_file = pkg_name+'/tools.py' 142 py_file = pkg_name+'/tools.py'
143 cpp_file = pkg_name+'/tools_wrap.cpp' 143 cpp_file = pkg_name+'/tools_wrap.cpp'
144 - os.system('cp %s %s' % ('@srcdir@/'+cpp_file, '@builddir@/'+cpp_file))  
145 - os.system('cp %s %s' % ('@srcdir@/'+py_file, '@builddir@/'+py_file)) 144 + os.system('cp %s %s' % ('@top_srcdir@/pyext/'+cpp_file, '@top_builddir@/pyext/'+cpp_file))
  145 + os.system('cp %s %s' % ('@top_srcdir@/pyext/'+py_file, '@top_builddir@/pyext/'+py_file))
146 146
147 # In case that the build directory is different from the source directory 147 # In case that the build directory is different from the source directory
148 # then copy all cscripts and parfiles from the source directory to the 148 # then copy all cscripts and parfiles from the source directory to the
test/Makefile.am
@@ -49,6 +49,8 @@ all-local: @@ -49,6 +49,8 @@ all-local:
49 49
50 # Files to be removed in build directory 50 # Files to be removed in build directory
51 clean-local: 51 clean-local:
  52 + rm -rf $(top_builddir)/test/*.pyc
  53 + rm -rf $(top_builddir)/test/__pycache__
52 rm -rf $(top_builddir)/test/*.fits 54 rm -rf $(top_builddir)/test/*.fits
53 rm -rf $(top_builddir)/test/*.log 55 rm -rf $(top_builddir)/test/*.log
54 rm -rf $(top_builddir)/test/*.xml 56 rm -rf $(top_builddir)/test/*.xml