From f79809f04ed784e802b94e23529ab86c124c1f1d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 12 Jun 2017 11:20:55 +0800 Subject: sky.py: Fix mkdir when the directory name is empty --- fg21sim/sky.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fg21sim') 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"): -- cgit v1.2.2