Skip to content

Commit

Permalink
Set irafarch only if it could be determined
Browse files Browse the repository at this point in the history
  • Loading branch information
olebole committed Jun 4, 2024
1 parent e856299 commit c87e31a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pyraf/iraffunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ def Init(doprint=1, hush=0, savefile=None):
iraf = _os.environ['iraf']

if "IRAFARCH" not in _os.environ:
_os.environ["IRAFARCH"] = _getIrafArch(iraf)
arch = _os.environ["IRAFARCH"]
arch = _getIrafArch(iraf)
if arch is not None:
_os.environ["IRAFARCH"] = arch
else:
arch = _os.environ["IRAFARCH"]

# stacksize problem on linux
# https://iraf-community.github.io/iraf-v216/issues/61
Expand Down Expand Up @@ -309,14 +312,14 @@ def _getIrafArch(iraf):
return m[1]

# Retrieve it from the irafarch script
fname = _os.path.join(iraf, "unix", "hlib", "irafarch")
if _os.path.exists(fname):
import subprocess
exitcode, arch = subprocess.getstatusoutput(f"{fname} -actual")
if exitcode == 0:
return arch
#fname = _os.path.join(iraf, "unix", "hlib", "irafarch.sh")
#if _os.path.exists(fname):
# import subprocess
# exitcode, arch = subprocess.getstatusoutput(f"{fname} -actual")
# if exitcode == 0:
# return arch

return ""
return None

# module variables that don't get saved (they get
# initialized when this module is imported)
Expand Down

0 comments on commit c87e31a

Please sign in to comment.