lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r933403 - /lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp
Date Mon, 12 Apr 2010 20:41:04 GMT
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);
 



Mime
View raw message