diff --git a/src/PythonQt.cpp b/src/PythonQt.cpp index c6fdef4..f6721a8 100644 --- a/src/PythonQt.cpp +++ b/src/PythonQt.cpp @@ -1146,7 +1146,7 @@ void PythonQtPrivate::registerCPPClass(const char* typeName, const char* parentT PyObject* PythonQtPrivate::packageByName(const char* name) { if (name==NULL || name[0]==0) { - return _pythonQtModule; + name = "private"; } PyObject* v = _packages.value(name); if (!v) { diff --git a/src/PythonQt.h b/src/PythonQt.h index 1f39302..1e98d92 100644 --- a/src/PythonQt.h +++ b/src/PythonQt.h @@ -479,6 +479,9 @@ public: //! called by virtual overloads when a python return value can not be converted to the required Qt type void handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result); + //! get access to the PythonQt module + PythonQtObjectPtr pythonQtModule() const { return _pythonQtModule; } + private: //! Setup the shared library suffixes by getting them from the "imp" module. void setupSharedLibrarySuffixes();