Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_region(self, include, region_type, region_end, line):
"""
Extract a Shape from a region string
"""
if self.coordsys is None:
raise DS9RegionParserError("No coordinate system specified and a"
" region has been found.")
else:
helper = DS9RegionParser(coordsys=self.coordsys,
include=include,
region_type=region_type,
region_end=region_end,
global_meta=self.global_meta,
line=line)
helper.parse()
self.shapes.append(helper.shape)
def _raise_error(self, msg):
if self.errors == 'warn':
warn(msg, DS9RegionParserWarning)
elif self.errors == 'strict':
raise DS9RegionParserError(msg)