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 080b9ad
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pyraf/iraffunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def Init(doprint=1, hush=0, savefile=None):
iraf = _os.environ['iraf']

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

arch = _os.environ["IRAFARCH"]

# stacksize problem on linux
Expand Down Expand Up @@ -309,12 +311,12 @@ 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 ""

Expand Down

0 comments on commit 080b9ad

Please sign in to comment.