diff options
Diffstat (limited to 'src/Interpreter.zig')
| -rw-r--r-- | src/Interpreter.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Interpreter.zig b/src/Interpreter.zig index 6862706..6768659 100644 --- a/src/Interpreter.zig +++ b/src/Interpreter.zig @@ -4,7 +4,7 @@ const zpy = @import("root.zig"); const Self = @This(); -globals: zpy.Dict, +globals: *zpy.Dict, pub fn init() !Self { c.Py_Initialize(); @@ -20,14 +20,14 @@ pub const RunOptions = struct { locals: ?*zpy.Dict = null, }; -pub fn run(self: *Self, str: [*c]const u8, options: RunOptions) zpy.Error!zpy.Object { +pub fn run(self: *Self, str: [*c]const u8, options: RunOptions) !*zpy.Object { if (c.PyRun_String( str, c.Py_file_input, - self.globals.object.ptr, - if (options.locals) |loc| loc.object.ptr else null, + @ptrCast(self.globals), + @ptrCast(options.locals), )) |object| { - return .fromPtr(object); + return @ptrCast(object); } return error.Exception; |