From 72d17d9e61f0c38e293a3e8773b046975ac570d5 Mon Sep 17 00:00:00 2001 From: smbaker Date: Thu, 5 Jan 2012 22:48:06 -0800 Subject: [PATCH] handle blank rspecs without faulting --- sface/sfidata.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sface/sfidata.py b/sface/sfidata.py index 4f2749e..9a2710a 100644 --- a/sface/sfidata.py +++ b/sface/sfidata.py @@ -80,9 +80,11 @@ class SfiData: rspec_file = config.getSliceRSpecFile() if os.path.exists(rspec_file): xml = open(rspec_file).read() - rspec = RSpec(rspec=xml) #rspec = parse_rspec(xml) - #self.purgeNonSliceResources(rspec) + if (xml.strip()==""): + return None + + rspec = RSpec(rspec=xml) return rspec return None @@ -91,7 +93,11 @@ class SfiData: rspec_file = config.getResourcesRSpecFile() if os.path.exists(rspec_file): xml = open(rspec_file).read() - rspec = RSpec(rspec=xml) #rspec= parse_rspec(xml) + + if (xml.strip()==""): + return None + + rspec = RSpec(rspec=xml) return rspec return None -- 2.43.0