MCPcopy Create free account
hub / github.com/aio-libs/multidict / _patch

Method _patch

tools/upgrade_pythoncapi.py:579–595  ·  view source on GitHub ↗
(self, content)

Source from the content-addressed store, hash-verified

577 return content
578
579 def _patch(self, content):
580 try:
581 has = (self.args.no_compat
582 or INCLUDE_PYTHONCAPI_COMPAT in content
583 or INCLUDE_PYTHONCAPI_COMPAT2 in content)
584 self._has_pythoncapi_compat = has
585 self._applied_operations = []
586 for operation in self.operations:
587 new_content = operation.patch(content)
588 if new_content != content:
589 self._applied_operations.append(operation.NAME)
590 content = new_content
591 applied_operations = self._applied_operations
592 finally:
593 self._has_pythoncapi_compat = None
594 self._applied_operations = None
595 return (content, applied_operations)
596
597 def patch(self, content):
598 return self._patch(content)[0]

Callers 2

patchMethod · 0.95
patch_fileMethod · 0.95

Calls 1

patchMethod · 0.45

Tested by

no test coverage detected