Skip to content

bpo-43444: Move sqlite3 MODULE_NAME from setup.py to Modules/_sqlite/module.h #24801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Modules/_sqlite/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

#ifndef PYSQLITE_CACHE_H
#define PYSQLITE_CACHE_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "module.h"

/* The LRU cache is implemented as a combination of a doubly-linked with a
* dictionary. The list items are of type 'Node' and the dictionary has the
Expand Down
1 change: 1 addition & 0 deletions Modules/_sqlite/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "Python.h"

#define PYSQLITE_VERSION "2.6.0"
#define MODULE_NAME "sqlite3"

extern PyObject* pysqlite_Error;
extern PyObject* pysqlite_Warning;
Expand Down
3 changes: 1 addition & 2 deletions Modules/_sqlite/prepare_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

#ifndef PYSQLITE_PREPARE_PROTOCOL_H
#define PYSQLITE_PREPARE_PROTOCOL_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "module.h"

typedef struct
{
Expand Down
1 change: 0 additions & 1 deletion PCbuild/_sqlite3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(sqlite3Dir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MODULE_NAME="sqlite3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,12 +1571,7 @@ def detect_sqlite(self):
'_sqlite/row.c',
'_sqlite/statement.c',
'_sqlite/util.c', ]

sqlite_defines = []
if not MS_WINDOWS:
sqlite_defines.append(('MODULE_NAME', '"sqlite3"'))
else:
sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))

# Enable support for loadable extensions in the sqlite3 module
# if --enable-loadable-sqlite-extensions configure option is used.
Expand Down