aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/runtime_py3/main
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /library/python/runtime_py3/main
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/runtime_py3/main')
-rw-r--r--library/python/runtime_py3/main/main.c52
-rw-r--r--library/python/runtime_py3/main/ya.make8
2 files changed, 30 insertions, 30 deletions
diff --git a/library/python/runtime_py3/main/main.c b/library/python/runtime_py3/main/main.c
index 3159800615..939c290827 100644
--- a/library/python/runtime_py3/main/main.c
+++ b/library/python/runtime_py3/main/main.c
@@ -1,5 +1,5 @@
#include <Python.h>
-#include <contrib/tools/python3/src/Include/internal/pycore_runtime.h> // _PyRuntime_Initialize()
+#include <contrib/tools/python3/src/Include/internal/pycore_runtime.h> // _PyRuntime_Initialize()
#include <stdlib.h>
#include <string.h>
@@ -9,7 +9,7 @@ void Py_InitArgcArgv(int argc, wchar_t **argv);
char* GetPyMain();
static const char* env_entry_point = "Y_PYTHON_ENTRY_POINT";
-static const char* env_bytes_warning = "Y_PYTHON_BYTES_WARNING";
+static const char* env_bytes_warning = "Y_PYTHON_BYTES_WARNING";
#ifdef _MSC_VER
extern char** environ;
@@ -74,11 +74,11 @@ static int RunModule(const char *modname)
}
static int pymain(int argc, char** argv) {
- PyStatus status = _PyRuntime_Initialize();
- if (PyStatus_Exception(status)) {
- Py_ExitStatusException(status);
- }
-
+ PyStatus status = _PyRuntime_Initialize();
+ if (PyStatus_Exception(status)) {
+ Py_ExitStatusException(status);
+ }
+
int i, sts = 1;
char* oldloc = NULL;
wchar_t** argv_copy = NULL;
@@ -95,15 +95,15 @@ static int pymain(int argc, char** argv) {
}
}
- PyConfig config;
- PyConfig_InitPythonConfig(&config);
- config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */
-
- const char* bytes_warning = getenv(env_bytes_warning);
- if (bytes_warning) {
- config.bytes_warning = atoi(bytes_warning);
- }
-
+ PyConfig config;
+ PyConfig_InitPythonConfig(&config);
+ config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */
+
+ const char* bytes_warning = getenv(env_bytes_warning);
+ if (bytes_warning) {
+ config.bytes_warning = atoi(bytes_warning);
+ }
+
oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
if (!oldloc) {
fprintf(stderr, "out of memory\n");
@@ -116,7 +116,7 @@ static int pymain(int argc, char** argv) {
argv_copy2[i] = argv_copy[i];
if (!argv_copy[i]) {
fprintf(stderr, "Unable to decode the command line argument #%i\n",
- i + 1);
+ i + 1);
argc = i;
goto error;
}
@@ -125,15 +125,15 @@ static int pymain(int argc, char** argv) {
PyMem_RawFree(oldloc);
oldloc = NULL;
- if (argc >= 1)
- Py_SetProgramName(argv_copy[0]);
-
- status = Py_InitializeFromConfig(&config);
- PyConfig_Clear(&config);
- if (PyStatus_Exception(status)) {
- Py_ExitStatusException(status);
- }
-
+ if (argc >= 1)
+ Py_SetProgramName(argv_copy[0]);
+
+ status = Py_InitializeFromConfig(&config);
+ PyConfig_Clear(&config);
+ if (PyStatus_Exception(status)) {
+ Py_ExitStatusException(status);
+ }
+
const char* entry_point = getenv(env_entry_point);
if (entry_point) {
entry_point_copy = strdup(entry_point);
diff --git a/library/python/runtime_py3/main/ya.make b/library/python/runtime_py3/main/ya.make
index f308a93b28..30a96c8728 100644
--- a/library/python/runtime_py3/main/ya.make
+++ b/library/python/runtime_py3/main/ya.make
@@ -14,10 +14,10 @@ ADDINCL(
contrib/tools/python3/src/Include
)
-CFLAGS(
- -DPy_BUILD_CORE
-)
-
+CFLAGS(
+ -DPy_BUILD_CORE
+)
+
SRCS(
main.c
get_py_main.cpp