diff options
| author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2016-03-08 18:35:55 +0100 |
|---|---|---|
| committer | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2016-03-08 18:52:29 +0100 |
| commit | 2de2ed7c6354fb640b43ce24cf45bdb5183fd408 (patch) | |
| tree | df460214b1d615451a5d34f1c2ffb045d704ca3b | |
| parent | 1d52f34e6045648397709c74b3c2538404dc679a (diff) | |
| download | psycopg2-2de2ed7c6354fb640b43ce24cf45bdb5183fd408.tar.gz | |
Remove some dead code
| -rw-r--r-- | psycopg/psycopg.h | 2 | ||||
| -rw-r--r-- | psycopg/psycopgmodule.c | 2 | ||||
| -rw-r--r-- | psycopg/utils.c | 44 |
3 files changed, 1 insertions, 47 deletions
diff --git a/psycopg/psycopg.h b/psycopg/psycopg.h index 7834cf6..adda12d 100644 --- a/psycopg/psycopg.h +++ b/psycopg/psycopg.h @@ -125,8 +125,6 @@ RAISES HIDDEN PyObject *psyco_set_error(PyObject *exc, cursorObject *curs, const HIDDEN char *psycopg_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, char *to, Py_ssize_t *tolen); HIDDEN char *psycopg_escape_identifier_easy(const char *from, Py_ssize_t len); -HIDDEN char *psycopg_escape_conninfo(const char *from, Py_ssize_t len); - HIDDEN int psycopg_strdup(char **to, const char *from, Py_ssize_t len); HIDDEN int psycopg_is_text_file(PyObject *f); diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index 5e8eb5b..c08cd70 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -73,7 +73,6 @@ HIDDEN PyObject *psyco_null = NULL; /* The type of the cursor.description items */ HIDDEN PyObject *psyco_DescriptionType = NULL; - /** connect module-level function **/ #define psyco_connect_doc \ "_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n" @@ -87,6 +86,7 @@ psyco_connect(PyObject *self, PyObject *args, PyObject *keywds) int async = 0; static char *kwlist[] = {"dsn", "connection_factory", "async", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Oi", kwlist, &dsn, &factory, &async)) { return NULL; diff --git a/psycopg/utils.c b/psycopg/utils.c index e9dc3ba..ec8e47c 100644 --- a/psycopg/utils.c +++ b/psycopg/utils.c @@ -124,50 +124,6 @@ psycopg_escape_identifier_easy(const char *from, Py_ssize_t len) return rv; } -char * -psycopg_escape_conninfo(const char *from, Py_ssize_t len) -{ - char *rv = NULL; - const char *src; - const char *end; - char *dst; - int space = 0; - - if (!len) { len = strlen(from); } - end = from + len; - - if (!(rv = PyMem_Malloc(3 + 2 * len))) { - PyErr_NoMemory(); - return NULL; - } - - /* check for any whitespace or empty string */ - if (from < end && *from) { - for (src = from; src < end && *src; ++src) { - if (isspace(*src)) { - space = 1; - break; - } - } - } else { - /* empty string: we should produce '' */ - space = 1; - } - - dst = rv; - if (space) { *(dst++) = '\''; } - /* scan and copy */ - for (src = from; src < end && *src; ++src, ++dst) { - if (*src == '\'' || *src == '\\') - *(dst++) = '\\'; - *dst = *src; - } - if (space) { *(dst++) = '\''; } - *dst = '\0'; - - return rv; -} - /* Duplicate a string. * * Allocate a new buffer on the Python heap containing the new string. |
