Skip to content

Commit d25e35f

Browse files
authored
YQL-18463: Adjust BadFromPythonLong for Python 2.x (#4812)
1 parent 9529d2c commit d25e35f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,23 @@ Y_UNIT_TEST_SUITE(TPyCastTest) {
6868
yexception, "Cast error object '3 <dot> 1415926' to Float");
6969
}
7070

71+
#if PY_MAJOR_VERSION >= 3
72+
# define RETVAL "-1"
73+
#else
74+
# define RETVAL "-18446744073709551616L"
75+
#endif
76+
7177
Y_UNIT_TEST(BadFromPythonLong) {
7278
TPythonTestEngine engine;
7379
UNIT_ASSERT_EXCEPTION_CONTAINS(
7480
engine.ToMiniKQL<ui64>(
7581
"def Test():\n"
76-
" return -1",
82+
" return " RETVAL,
7783
[](const NUdf::TUnboxedValuePod& value) {
7884
Y_UNUSED(value);
7985
Y_UNREACHABLE();
8086
}),
81-
yexception, "Cast error object -1 to Long");
87+
yexception, "Cast error object " RETVAL " to Long");
8288
}
8389

8490
}

0 commit comments

Comments
 (0)