You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-commits@lucene.apache.org by va...@apache.org on 2010/04/12 22:41:04 UTC

svn commit: r933403 - /lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp

Author: vajda
Date: Mon Apr 12 20:41:04 2010
New Revision: 933403

URL: http://svn.apache.org/viewvc?rev=933403&view=rev
Log:
move ver setting code out of _once_only

Modified:
    lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp

Modified: lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp?rev=933403&r1=933402&r2=933403&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp Mon Apr 12 20:41:04 2010
@@ -298,20 +298,19 @@ static void registerNatives(JNIEnv *vm_e
 _DLL_EXPORT PyObject *initJCC(PyObject *module)
 {
     static int _once_only = 1;
+#ifdef _MSC_VER
+#define verstring(n) #n
+    PyObject *ver = PyString_FromString(verstring(JCC_VER));
+#else
+    PyObject *ver = PyString_FromString(JCC_VER);
+#endif
+    PyObject_SetAttrString(module, "JCC_VERSION", ver); Py_DECREF(ver);
 
     if (_once_only)
     {
         PyEval_InitThreads();
         INSTALL_TYPE(JCCEnv, module);
 
-#ifdef _MSC_VER
-#define verstring(n) #n
-        PyObject *ver = PyString_FromString(verstring(JCC_VER));
-#else
-        PyObject *ver = PyString_FromString(JCC_VER);
-#endif
-        PyObject_SetAttrString(module, "JCC_VERSION", ver); Py_DECREF(ver);
-
         if (env == NULL)
             env = new JCCEnv(NULL, NULL);