summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-15 13:21:21 (GMT)
committerGitHub <noreply@github.com>2021-10-15 13:21:21 (GMT)
commit354c35220d25a893e502014478f6739dad6897f3 (patch)
treef9610f948f228ea37c1b5c8a7dd0dc0e2c8f7324 /Include
parenta7f8dfd25a167ccfde9996c499fa38a2aba60022 (diff)
downloadcpython-354c35220d25a893e502014478f6739dad6897f3.zip
cpython-354c35220d25a893e502014478f6739dad6897f3.tar.gz
cpython-354c35220d25a893e502014478f6739dad6897f3.tar.bz2
bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)
Rename Include/namespaceobject.h to Include/internal/pycore_namespace.h. The _testmultiphase extension is now built with the Py_BUILD_CORE_MODULE macro defined to access _PyNamespace_Type. object.c: remove unused "pycore_context.h" include.
Diffstat (limited to 'Include')
-rw-r--r--Include/Python.h1
-rw-r--r--Include/internal/pycore_namespace.h20
-rw-r--r--Include/namespaceobject.h19
3 files changed, 20 insertions, 20 deletions
diff --git a/Include/Python.h b/Include/Python.h
index a2de514..c0a621a 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -77,7 +77,6 @@
#include "warnings.h"
#include "weakrefobject.h"
#include "structseq.h"
-#include "namespaceobject.h"
#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"
#include "codecs.h"
diff --git a/Include/internal/pycore_namespace.h b/Include/internal/pycore_namespace.h
new file mode 100644
index 0000000..cb76f04
--- /dev/null
+++ b/Include/internal/pycore_namespace.h
@@ -0,0 +1,20 @@
+// Simple namespace object interface
+
+#ifndef Py_INTERNAL_NAMESPACE_H
+#define Py_INTERNAL_NAMESPACE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
+PyAPI_DATA(PyTypeObject) _PyNamespace_Type;
+
+PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // !Py_INTERNAL_NAMESPACE_H
diff --git a/Include/namespaceobject.h b/Include/namespaceobject.h
deleted file mode 100644
index 0c8d95c..0000000
--- a/Include/namespaceobject.h
+++ /dev/null
@@ -1,19 +0,0 @@
-
-/* simple namespace object interface */
-
-#ifndef NAMESPACEOBJECT_H
-#define NAMESPACEOBJECT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef Py_LIMITED_API
-PyAPI_DATA(PyTypeObject) _PyNamespace_Type;
-
-PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds);
-#endif /* !Py_LIMITED_API */
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !NAMESPACEOBJECT_H */