diff options
| author | kkhamitov <[email protected]> | 2022-02-10 16:49:19 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:19 +0300 | 
| commit | 11c7da3bf8b14be64b7ddaf62ac657d4d2992b33 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yson/node/pybind/node.cpp | |
| parent | c8c0985466696c87722fd656d897925f14e25934 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/node/pybind/node.cpp')
| -rw-r--r-- | library/cpp/yson/node/pybind/node.cpp | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/library/cpp/yson/node/pybind/node.cpp b/library/cpp/yson/node/pybind/node.cpp index f44aca1fc54..79beba36471 100644 --- a/library/cpp/yson/node/pybind/node.cpp +++ b/library/cpp/yson/node/pybind/node.cpp @@ -49,21 +49,21 @@ namespace NPyBind {              res = 0.0;              return FromPyObject(obj, res.As<double>());          } -#if PY_MAJOR_VERSION < 3  +#if PY_MAJOR_VERSION < 3          if (PyString_Check(obj)) {              res = TString();              return FromPyObject(obj, res.As<TString>());          } -#else  -        if (PyUnicode_Check(obj)) {  -            res = TString();  -            return FromPyObject(obj, res.As<TString>());  -        }  +#else +        if (PyUnicode_Check(obj)) { +            res = TString(); +            return FromPyObject(obj, res.As<TString>()); +        }          if (PyBytes_Check(obj)) {              res = TString();              return FromPyObject(obj, res.As<TString>());          } -#endif  +#endif          if (PyList_Check(obj)) {              res = NYT::TNode::CreateList();              return FromPyObject(obj, res.AsList()); @@ -72,7 +72,7 @@ namespace NPyBind {              res = NYT::TNode::CreateMap();              return FromPyObject(obj, res.AsMap());          } -#if PY_MAJOR_VERSION < 3  +#if PY_MAJOR_VERSION < 3          if (PyInt_Check(obj)) {              auto valAsLong = PyInt_AsLong(obj);              if (valAsLong == -1 && PyErr_Occurred()) { @@ -81,7 +81,7 @@ namespace NPyBind {              res = valAsLong;              return true;          } -#endif  +#endif          if (PyLong_Check(obj)) {              int overflow = 0;              auto valAsLong = PyLong_AsLongAndOverflow(obj, &overflow); | 
