mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-20 05:30:57 +01:00
Rename v
to wrapped_func
in metawrapper.__newindex()
This commit is contained in:
parent
d76dd35791
commit
e06861bb0b
@ -110,8 +110,8 @@ return function(_python, _bridged)
|
|||||||
---@generic T : table
|
---@generic T : table
|
||||||
---@param t T
|
---@param t T
|
||||||
---@return T
|
---@return T
|
||||||
function metawrapper.__newindex(t, k, v)
|
function metawrapper.__newindex(t, k, wrapped_func)
|
||||||
if type(v) == "function" then
|
if type(wrapped_func) == "function" then
|
||||||
return rawset(t, k, function(...)
|
return rawset(t, k, function(...)
|
||||||
local _needs_unwrap = false
|
local _needs_unwrap = false
|
||||||
if not wrapped then
|
if not wrapped then
|
||||||
@ -120,7 +120,7 @@ return function(_python, _bridged)
|
|||||||
_needs_unwrap = true
|
_needs_unwrap = true
|
||||||
wrapped = true
|
wrapped = true
|
||||||
end
|
end
|
||||||
local r = {v(...)}
|
local r = {wrapped_func(...)}
|
||||||
if _needs_unwrap then
|
if _needs_unwrap then
|
||||||
metatables:restore()
|
metatables:restore()
|
||||||
wrapped = false
|
wrapped = false
|
||||||
@ -128,7 +128,7 @@ return function(_python, _bridged)
|
|||||||
return table.unpack(r)
|
return table.unpack(r)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
return rawset(t, k, v)
|
return rawset(t, k, wrapped_func)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user