Hi,
2013/06/05 Web 13:07:20 UTC+9 ZyX wrote:
> vim._*chdir is holding original implementations: I do not want to collect
> references at exit in python*_end() functions if I can just record them in
> the vim module and be sure that they both won’t get garbage-collected and
> will be correctly Py_DECREFed at exit.
I have updated the patch.
Now the patch adds a NULL check to avoid a crash, and also adds
help messages which say that vim.*chdir are used internally.
The messages can be seen when type the following commands:
:py help(vim.chdir)
:py help(vim.fchdir)
Thanks,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
# HG changeset patch
# Parent 54c996082422b13af75b4f4face40bfd1816dd5c
diff --git a/src/if_py_both.h b/src/if_py_both.h
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -718,6 +718,8 @@
PyObject *todecref;
char_u *new_dir;
+ if (!_chdir)
+ return NULL;
if (!(r = PyObject_Call(_chdir, args, kwargs)))
return NULL;
@@ -785,8 +787,8 @@
{"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" },
{"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"},
{"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts <Tab> as having width 1"},
- {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"},
- {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"},
+ {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory (Internal use only)"},
+ {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory (Internal use only)"},
{ NULL, NULL, 0, NULL }
};