Commit b422032dda9eacf8f25d1ba8d90b0bca83ba53d4

Authored by Jürgen Knödlseder
1 parent ab46b2ff

Make script Python version 2.3 compatible.

Showing 1 changed file with 5 additions and 2 deletions
cscripts/csobsinfo.py
... ... @@ -309,8 +309,11 @@ class csobsinfo(ctools.cscript):
309 309 self._log("%.2f" % (sum(self._azimuths)/len(self._azimuths)))
310 310 self._log(" deg\n")
311 311  
312   - # Optionally log name of observations
313   - if self._logExplicit():
  312 + # Optionally log names of observations. Note that the set class
  313 + # is used to extract all different observation names from the
  314 + # list of observation names, and the set class is only available
  315 + # from Python 2.4 on.
  316 + if self._logExplicit() and sys.version_info >= (2,4):
314 317 obs_set = set(obs_names)
315 318 for name in obs_set:
316 319 self._log.parformat("\""+name+"\"")
... ...