Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11_abseil
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11_abseil
Commits
55db5e0b
Commit
55db5e0b
authored
Feb 13, 2023
by
pybind11_abseil authors
Committed by
Copybara-Service
Feb 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal change.
PiperOrigin-RevId: 509255012
parent
38b42686
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
pybind11_abseil/register_status_bindings.cc
+12
-3
No files found.
pybind11_abseil/register_status_bindings.cc
View file @
55db5e0b
...
...
@@ -146,7 +146,6 @@ handle PyStatusNotOkTypeInUse() {
type_in_use
=
object
(
module_in_use
.
attr
(
"StatusNotOk"
)).
release
();
return
type_in_use
;
}
}
// namespace
namespace
internal
{
...
...
@@ -278,8 +277,15 @@ void RegisterStatusBindings(module m) {
// assumption is violated.
code_str
=
std
::
to_string
(
static_cast
<
int
>
(
s
.
code
()));
}
return
decode_utf8_replace
(
absl
::
StrCat
(
s
.
message
(),
" ["
,
code_str
,
"]"
));
auto
output
=
absl
::
StrCat
(
s
.
message
(),
" ["
,
code_str
,
"]"
);
return
decode_utf8_replace
(
output
);
})
.
def
(
"get_source_location_trace_str"
,
[](
const
absl
::
Status
&
s
)
->
std
::
string
{
if
(
!
s
.
ok
())
{
{};
}
return
{};
})
.
def_static
(
"OkStatus"
,
[]()
{
...
...
@@ -419,6 +425,9 @@ void RegisterStatusBindings(module m) {
def __str__(self):
return self._status.status_not_ok_str()
def get_source_location_trace_str(self):
return self._status.get_source_location_trace_str()
def __eq__(self, other):
if not isinstance(other, StatusNotOk):
return NotImplemented
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment