Index: /issm/trunk-jpl/src/c/python/include/python_macros.h
===================================================================
--- /issm/trunk-jpl/src/c/python/include/python_macros.h	(revision 12072)
+++ /issm/trunk-jpl/src/c/python/include/python_macros.h	(revision 12073)
@@ -28,5 +28,6 @@
 						 return output;
 //}}}
-/* WRAPPER {{{1*/
+#if _PYTHON_MAJOR_ >=3
+/* WRAPPER 3.2 {{{1*/
 #define WRAPPER(modulename,...)  \
 \
@@ -54,4 +55,23 @@
 static PyObject* modulename(PyObject* self,PyObject* args)
 /*}}}*/
+#else
+/* WRAPPER 2.7 {{{1*/
+#define WRAPPER(modulename,...)  \
+\
+static PyObject* modulename(PyObject* self,PyObject* args);\
+static PyMethodDef modulename##_funcs[] = {\
+	{#modulename, (PyCFunction)modulename, METH_VARARGS, ""},\
+	{NULL,NULL,0,NULL}\
+};\
+\
+PyMODINIT_FUNC init##modulename(void){\
+\
+	import_array();\
+	(void) Py_InitModule(#modulename, modulename##_funcs);\
+}\
+\
+static PyObject* modulename(PyObject* self,PyObject* args)
+/*}}}*/
+#endif
 /* CHECKARGUMENTS {{{1*/
 #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumPythonArguments(args, NRHS,functionpointer)
Index: /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp
===================================================================
--- /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12072)
+++ /issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp	(revision 12073)
@@ -16,19 +16,5 @@
 #include "../../shared/shared.h"
 
-/*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{1*/
-void FetchData(char** pstring,PyObject* py_unicode){
-
-	PyObject* py_bytes;
-	char* string=NULL;
-
-	
-	/*convert to bytes format: */
-	PyUnicode_FSConverter(py_unicode,&py_bytes);
-
-	/*convert from bytes to string: */
-	string=PyBytes_AS_STRING(py_bytes);
-	
-	*pstring=string;
-}
+/*Primitive data types*/
 /*FUNCTION FetchData(double* pscalar,PyObject* py_float){{{1*/
 void FetchData(double* pscalar,PyObject* py_float){
@@ -71,2 +57,34 @@
 }
 /*}}}*/
+
+/*Python version dependent: */
+#if _PYTHON_MAJOR_ >= 3 
+/*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{1*/
+void FetchData(char** pstring,PyObject* py_unicode){
+
+	PyObject* py_bytes;
+	char* string=NULL;
+
+	
+	/*convert to bytes format: */
+	PyUnicode_FSConverter(py_unicode,&py_bytes);
+
+	/*convert from bytes to string: */
+	string=PyBytes_AS_STRING(py_bytes);
+	
+	*pstring=string;
+}
+/*}}}*/
+#else
+/*FUNCTION FetchData(char** pstring,PyObject* py_string){{{1*/
+void FetchData(char** pstring,PyObject* py_string){
+
+	char* string=NULL;
+
+	/*extract internal string: */
+	string=PyString_AsString(py_string);
+	
+	*pstring=string;
+}
+/*}}}*/
+#endif
