Skip to content

Commit 78be192

Browse files
authored
Merge 9fee47e into a1ecba7
2 parents a1ecba7 + 9fee47e commit 78be192

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)