#define MEDCOUPLING_EXPORT
#define MEDLOADER_EXPORT
+// Little trick to give precedence to MEDCoupling namespace if
+// both modules MEDLoader and MEDCoupling were loaded. Basically we cancel out SWIG type
+// registration during the loading of MEDLoader if MEDCoupling is already there.
+%pythoncode %{
+import sys
+if sys.modules.has_key('MEDCoupling'):
+ mc_mod = sys.modules['MEDCoupling']
+ for k, v in mc_mod.__dict__.items():
+ if k.startswith("MED") and type(v) is type(type):
+ exec("_MEDLoader.%s_swigregister = lambda x: None" % k)
+%}
+
%include "MEDCouplingCommon.i"
%{