From f13432298770fc46d75e97708de4c66dc544aa10 Mon Sep 17 00:00:00 2001 From: BLUELOVETH Date: Mon, 8 May 2023 17:28:47 +0800 Subject: [PATCH] Update pocketpy.h --- src/pocketpy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketpy.h b/src/pocketpy.h index 70c0451e..ea9c5227 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -181,7 +181,7 @@ inline void init_builtins(VM* _vm) { _vm->bind_builtin_func<1>("dir", [](VM* vm, ArgsView args) { std::set names; - if(args[0]->is_attr_valid()){ + if(!is_tagged(args[0] && args[0]->is_attr_valid()){ std::vector keys = args[0]->attr().keys(); names.insert(keys.begin(), keys.end()); } @@ -1110,4 +1110,4 @@ extern "C" { _pk_deleter_map[p] = [](void* p){ delete (pkpy::VM*)p; }; return p; } -} \ No newline at end of file +}