Skip to content

Commit bf2d754

Browse files
committed
Rename _pygit2._cache_enums
1 parent 59d6ace commit bf2d754

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pygit2/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
# Low level API
3232
from ._pygit2 import *
33+
from ._pygit2 import _cache_enums
3334

3435
# High level API
3536
from . import enums
@@ -61,8 +62,7 @@
6162

6263
# Let _pygit2 cache references to Python enum types.
6364
# This is separate from PyInit__pygit2() to avoid a circular import.
64-
cache_enums()
65-
del cache_enums # Don't expose this to user code
65+
_cache_enums()
6666

6767

6868
def init_repository(

src/pygit2.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,16 @@ forget_enums(void)
379379
Py_CLEAR(MergePreferenceEnum);
380380
}
381381

382-
PyDoc_STRVAR(cache_enums__doc__,
383-
"cache_enums()\n"
382+
PyDoc_STRVAR(_cache_enums__doc__,
383+
"_cache_enums()\n"
384384
"\n"
385385
"For internal use only. Do not call this from user code.\n"
386386
"\n"
387387
"Let the _pygit2 C module cache references to Python enums\n"
388388
"defined in pygit2.enums.\n");
389389

390390
PyObject *
391-
cache_enums(PyObject *self, PyObject *args)
391+
_cache_enums(PyObject *self, PyObject *args)
392392
{
393393
(void) args;
394394

@@ -439,7 +439,7 @@ PyMethodDef module_methods[] = {
439439
{"tree_entry_cmp", tree_entry_cmp, METH_VARARGS, tree_entry_cmp__doc__},
440440
{"filter_register", (PyCFunction)filter_register, METH_VARARGS | METH_KEYWORDS, filter_register__doc__},
441441
{"filter_unregister", filter_unregister, METH_VARARGS, filter_unregister__doc__},
442-
{"cache_enums", cache_enums, METH_NOARGS, cache_enums__doc__},
442+
{"_cache_enums", _cache_enums, METH_NOARGS, _cache_enums__doc__},
443443
{NULL}
444444
};
445445

0 commit comments

Comments
 (0)