Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
bpo-43444: Move sqlite3 MODULE_NAME from setup.py to Modules/_sqlite/…
…module.h
  • Loading branch information
Erlend E. Aasland committed Mar 9, 2021
commit 91d84d168095b0bb6744241749d4e8fbbe4cbcc1
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
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