| 104 | } // namespace |
| 105 | |
| 106 | void registerBinding(RegisterBindingFunc f) |
| 107 | { |
| 108 | if (sModule) |
| 109 | { |
| 110 | try |
| 111 | { |
| 112 | f(sModule); |
| 113 | } |
| 114 | catch (const std::exception& e) |
| 115 | { |
| 116 | PyErr_SetString(PyExc_ImportError, e.what()); |
| 117 | reportErrorAndContinue(e.what()); |
| 118 | return; |
| 119 | } |
| 120 | } |
| 121 | else |
| 122 | { |
| 123 | registerDeferredBinding(getUniqueDeferredBindingName(), f); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | void registerDeferredBinding(const std::string& name, RegisterBindingFunc f) |
| 128 | { |