aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-07-08 19:00:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-07-08 19:00:11 +0000
commit6d297e0551a2a3cc048655796230cdff5e559952 (patch)
tree9431966a46cbea474453e046fce68a4500ecbad9 /src
parent803716013dc1350f8cd97fdfca4bdffc9a52021c (diff)
downloadpostgresql-6d297e0551a2a3cc048655796230cdff5e559952.tar.gz
postgresql-6d297e0551a2a3cc048655796230cdff5e559952.zip
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.)
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/plpython.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 4a71b8bf534..e1a976ec6e5 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -1,7 +1,7 @@
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.147 2010/07/08 18:42:12 petere Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.148 2010/07/08 19:00:11 tgl Exp $
*
*********************************************************************
*/
@@ -3220,6 +3220,9 @@ _PG_init(void)
static bool inited = false;
const int **version_ptr;
+ if (inited)
+ return;
+
/* Be sure we don't run Python 2 and 3 in the same session (might crash) */
version_ptr = (const int **) find_rendezvous_variable("plpython_python_version");
if (!(*version_ptr))
@@ -3234,9 +3237,6 @@ _PG_init(void)
errhint("Start a new session to use a different Python major version.")));
}
- if (inited)
- return;
-
pg_bindtextdomain(TEXTDOMAIN);
#if PY_MAJOR_VERSION >= 3