Skip to content

Commit 6d297e0

Browse files
committed
Minor kibitzing on previous patch: no need to run check more than once.
(_PG_init should be called only once anyway, but as long as it's got an internal guard against repeat calls, that should be in front of the version check.)
1 parent 8037160 commit 6d297e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pl/plpython/plpython.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.147 2010/07/08 18:42:12 petere Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.148 2010/07/08 19:00:11 tgl Exp $
55
*
66
*********************************************************************
77
*/
@@ -3220,6 +3220,9 @@ _PG_init(void)
32203220
static bool inited = false;
32213221
const int **version_ptr;
32223222

3223+
if (inited)
3224+
return;
3225+
32233226
/* Be sure we don't run Python 2 and 3 in the same session (might crash) */
32243227
version_ptr = (const int **) find_rendezvous_variable("plpython_python_version");
32253228
if (!(*version_ptr))
@@ -3234,9 +3237,6 @@ _PG_init(void)
32343237
errhint("Start a new session to use a different Python major version.")));
32353238
}
32363239

3237-
if (inited)
3238-
return;
3239-
32403240
pg_bindtextdomain(TEXTDOMAIN);
32413241

32423242
#if PY_MAJOR_VERSION >= 3

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy