Skip to content

Commit c552d73

Browse files
committed
fix
1 parent bbf7ee3 commit c552d73

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ydb/library/yql/udfs/common/python/python_udf/python_udf.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "python_udf.h"
22
#include "python_function_factory.h"
33

4-
#include <ydb/library/yql/public/udf/udf_version.h>
5-
#include <ydb/library/yql/udfs/common/python/bindings/py_utils.h>
4+
#include <contrib/ydb/library/yql/public/udf/udf_version.h>
5+
#include <contrib/ydb/library/yql/udfs/common/python/bindings/py_utils.h>
66

77
#include <util/generic/vector.h>
88
#include <util/system/execpath.h>
@@ -76,9 +76,10 @@ os.environ['OPENBLAS_NUM_THREADS'] = '1'
7676
import sys
7777
import threading
7878
if sys.version_info >= (3, 0):
79-
from io import StringIO
79+
from io import StringIO, TextIOWrapper as SysStderrType
8080
else:
8181
from cStringIO import StringIO
82+
SysStderrType = file
8283
8384
class StderrLocal(threading.local):
8485
@@ -108,7 +109,8 @@ class StderrProxy(object):
108109
109110
return getattr(target, attr)
110111
111-
sys.stderr = StderrProxy(sys.stderr)
112+
if isinstance(sys.stderr, SysStderrType):
113+
sys.stderr = StderrProxy(sys.stderr)
112114
)");
113115
Y_ABORT_UNLESS(rc >= 0, "Can't setup module");
114116

0 commit comments

Comments
 (0)