aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-06-12 11:20:55 +0800
committerAaron LI <aly@aaronly.me>2017-06-12 11:20:55 +0800
commitf79809f04ed784e802b94e23529ab86c124c1f1d (patch)
tree93caa451bb522d6cba8576922d0510a01e7aa6e2 /fg21sim
parent8a41a25f708b031e8375a6ab75bd3adc20a20b47 (diff)
downloadfg21sim-f79809f04ed784e802b94e23529ab86c124c1f1d.tar.bz2
sky.py: Fix mkdir when the directory name is empty
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/sky.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/fg21sim/sky.py b/fg21sim/sky.py
index 2c176ff..9187777 100644
--- a/fg21sim/sky.py
+++ b/fg21sim/sky.py
@@ -167,7 +167,7 @@ class SkyPatch:
Write current data to file.
"""
outdir = os.path.dirname(outfile)
- if not os.path.exists(outdir):
+ if outdir and (not os.path.exists(outdir)):
os.makedirs(outdir)
logger.info("Created output directory: %s" % outdir)
image = self.data.reshape(self.ysize, self.xsize)
@@ -363,7 +363,7 @@ class SkyHealpix:
Write current data to file.
"""
outdir = os.path.dirname(outfile)
- if not os.path.exists(outdir):
+ if outdir and (not os.path.exists(outdir)):
os.makedirs(outdir)
logger.info("Created output directory: %s" % outdir)
if hasattr(self, "header"):