mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-13 04:27:00 +08:00
Refactor: Move del_cached_property to module.base.decorator
This commit is contained in:
@@ -94,6 +94,20 @@ class cached_property:
|
||||
return value
|
||||
|
||||
|
||||
def del_cached_property(obj, name):
|
||||
"""
|
||||
Delete a cached property safely.
|
||||
|
||||
Args:
|
||||
obj:
|
||||
name (str):
|
||||
"""
|
||||
try:
|
||||
del obj.__dict__[name]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
def function_drop(rate=0.5, default=None):
|
||||
"""
|
||||
Drop function calls to simulate random emulator stuck, for testing purpose.
|
||||
|
||||
Reference in New Issue
Block a user