diff options
author | spreis <spreis@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
commit | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (patch) | |
tree | d41d29a041d5733ef148335290dbb817b197d4cd /contrib/libs/python/ut/lib/test.cpp | |
parent | 986cb5d624f352524bfa0c42c9a7695235cdaa41 (diff) | |
download | ydb-bcd1126cbd5d445cd0665d295198aa39c6ab8cbe.tar.gz |
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 1 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 e3aabc8889..824b7460e1 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(); +} |