diff options
author | spreis <[email protected]> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:13 +0300 |
commit | b49848d6e361b76904f094b7d5e10d6edea75afe (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /contrib/libs/python/ut/lib/test.cpp | |
parent | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/python/ut/lib/test.cpp')
-rw-r--r-- | contrib/libs/python/ut/lib/test.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libs/python/ut/lib/test.cpp b/contrib/libs/python/ut/lib/test.cpp index 824b7460e17..e3aabc8889f 100644 --- a/contrib/libs/python/ut/lib/test.cpp +++ b/contrib/libs/python/ut/lib/test.cpp @@ -1,21 +1,21 @@ -#include "test.h" - -#include <Python.h> +#include "test.h" + +#include <Python.h> #include <library/cpp/testing/unittest/registar.h> - -TTestPyInvoker::TTestPyInvoker() {} - -const char* TTestPyInvoker::GetVersion() { - Py_Initialize(); - - auto* module = PyImport_ImportModule("sys"); - UNIT_ASSERT(module != nullptr); - - auto* versionObj = PyObject_GetAttrString(module, "version"); - if (versionObj == nullptr) { - Py_DECREF(module); - UNIT_ASSERT(versionObj != nullptr); - } - - return Py_GetVersion(); -} + +TTestPyInvoker::TTestPyInvoker() {} + +const char* TTestPyInvoker::GetVersion() { + Py_Initialize(); + + auto* module = PyImport_ImportModule("sys"); + UNIT_ASSERT(module != nullptr); + + auto* versionObj = PyObject_GetAttrString(module, "version"); + if (versionObj == nullptr) { + Py_DECREF(module); + UNIT_ASSERT(versionObj != nullptr); + } + + return Py_GetVersion(); +} |