File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
import logging
3
3
4
4
from .patches import *
5
- from .patches import __all__
5
+ from .patches import __all__ as all_patches
6
6
from .targets import Target
7
7
8
8
logger = logging .getLogger (__name__ )
@@ -64,10 +64,16 @@ def __init__(
64
64
InsertFunctionPatch ,
65
65
ModifyFunctionPatch ,
66
66
)
67
- assert len (self .patch_order ) == len (__all__ )
67
+ assert len (self .patch_order ) == len (all_patches )
68
68
69
69
def apply_patches (self ):
70
- self .patches .sort (key = lambda x : self .patch_order .index (type (x )))
70
+ # TODO: sort patches properly
71
+ # self.patches.sort(key=lambda x: self.patch_order.index(type(x)))
72
+ self .patches .sort (
73
+ key = lambda x : not isinstance (
74
+ x , (ModifyDataPatch , InsertDataPatch , RemoveDataPatch )
75
+ )
76
+ )
71
77
logger .debug (f"Applying patches: { self .patches } " )
72
78
for patch in self .patches :
73
79
patch .apply (self )
You can’t perform that action at this time.
0 commit comments