Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def end_run(self):
if not hasattr(self, "_end_run"):
ends = xpath(self.w_r, self.XPATH_FOLLOWING_ENDS)
if not ends:
msg = "Complex field without end node is not supported"
raise InvalidComplexField(msg)
self._end_run = ends[0]
return self._end_run
def begin_run(self):
begins = xpath(self.w_r, self.XPATH_PRECEDING_BEGINS)
if not begins:
msg = "Complex field without begin node is not supported"
raise InvalidComplexField(msg)
return begins[-1]