File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed
Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change 77from collections import defaultdict
88from collections .abc import Callable
99from functools import partial
10- from types import CodeType , TracebackType
10+ from types import CodeType
1111
1212from awepatch ._utils import (
1313 AWEPATCH_DEBUG ,
@@ -246,16 +246,3 @@ def restore(self) -> None:
246246 """Restore all original functions."""
247247 for patcher in self ._func_patchers .values ():
248248 patcher .restore ()
249-
250- def __enter__ (self ) -> None :
251- """Enter the context manager, applying all patches."""
252- self .apply ()
253-
254- def __exit__ (
255- self ,
256- exc_type : type [BaseException ] | None ,
257- exc_value : BaseException | None ,
258- traceback : TracebackType | None ,
259- ) -> None :
260- """Exit the context manager, restoring all original functions."""
261- self .restore ()
Original file line number Diff line number Diff line change @@ -316,11 +316,11 @@ def apply_prepared_patches(prepared: PreparedPatches) -> None:
316316class AbstractPatcher (ABC ):
317317 @abstractmethod
318318 def apply (self ) -> None :
319- """Apply the patches to the function ."""
319+ """Apply the patches."""
320320
321321 @abstractmethod
322322 def restore (self ) -> None :
323- """Restore the original function ."""
323+ """Restore the original code ."""
324324
325325 def __enter__ (self ) -> None :
326326 """Enter the context manager, applying the patches."""
@@ -332,7 +332,7 @@ def __exit__(
332332 exc_value : BaseException ,
333333 traceback : TracebackType ,
334334 ) -> None :
335- """Exit the context manager, restoring the original function ."""
335+ """Exit the context manager, restoring the original code ."""
336336 self .restore ()
337337
338338
You can’t perform that action at this time.
0 commit comments