Skip to content

Commit

Permalink
Allow state in root modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Oct 13, 2023
1 parent 7abc775 commit 4fc9eda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pydust/src/builtins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,14 @@ fn lift(comptime PydustStruct: type) !py.PyObject {
// Recursively resolve submodules / nested classes
if (comptime qualName.len > 1) {
inline for (qualName[1 .. qualName.len - 1]) |part| {
defer mod.decref();
const prev_mod = mod;
mod = try mod.get(part);
prev_mod.decref();
}

defer mod.decref();
const prev_mod = mod;
mod = try mod.get(qualName[qualName.len - 1]);
prev_mod.decref();
}

// Grab the attribute using the final part of the qualified name.
Expand Down

0 comments on commit 4fc9eda

Please sign in to comment.