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
bced1f03
Commit
bced1f03
authored
Oct 10, 2023
by
Matt McDonald
Committed by
Copybara-Service
Oct 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove definitions for `CanonicalCode()`, `error_message()`, and `get_source_location_trace_str()`
PiperOrigin-RevId: 572292285
parent
ba421f11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
23 deletions
+0
-23
pybind11_abseil/register_status_bindings.cc
+0
-20
pybind11_abseil/tests/status_test.py
+0
-3
No files found.
pybind11_abseil/register_status_bindings.cc
View file @
bced1f03
...
...
@@ -280,13 +280,6 @@ void RegisterStatusBindings(module m) {
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"
,
[]()
{
handle
py_singleton
(
pybind11_abseil
::
PyOkStatusSingleton
());
...
...
@@ -296,14 +289,6 @@ void RegisterStatusBindings(module m) {
return
py_singleton
;
})
.
def
(
"raw_code"
,
&
absl
::
Status
::
raw_code
)
.
def
(
"CanonicalCode"
,
[](
const
absl
::
Status
&
self
)
{
return
static_cast
<
int
>
(
self
.
code
());
})
.
def
(
"error_message"
,
[](
const
absl
::
Status
&
self
)
{
return
decode_utf8_replace
(
self
.
message
());
})
.
def
(
"IgnoreError"
,
&
absl
::
Status
::
IgnoreError
)
.
def
(
"SetPayload"
,
[](
absl
::
Status
&
self
,
absl
::
string_view
type_url
,
...
...
@@ -425,9 +410,6 @@ 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
...
...
@@ -435,8 +417,6 @@ void RegisterStatusBindings(module m) {
rhs = Status(InitFromTag.capsule, other._status)
return lhs == rhs
# NOTE: The absl::SourceLocation is lost.
# It is impossible to serialize-deserialize.
def __reduce_ex__(self, protocol):
del protocol
return (type(self), (self._status,))
...
...
pybind11_abseil/tests/status_test.py
View file @
bced1f03
...
...
@@ -64,8 +64,6 @@ class StatusTest(parameterized.TestCase):
ok_status
=
status
.
Status
.
OkStatus
()
self
.
assertEqual
(
ok_status
.
to_string
(),
'OK'
)
self
.
assertEqual
(
ok_status
.
raw_code
(),
0
)
self
.
assertEqual
(
ok_status
.
CanonicalCode
(),
0
)
self
.
assertEqual
(
ok_status
.
error_message
(),
''
)
self
.
assertIsNone
(
ok_status
.
IgnoreError
())
def
test_error_message_malformed_utf8
(
self
):
...
...
@@ -73,7 +71,6 @@ class StatusTest(parameterized.TestCase):
stx80
=
status
.
invalid_argument_error
(
malformed_utf8
)
self
.
assertEqual
(
stx80
.
message
(),
'�'
)
self
.
assertEqual
(
stx80
.
message_bytes
(),
malformed_utf8
)
self
.
assertEqual
(
stx80
.
error_message
(),
'�'
)
self
.
assertEqual
(
stx80
.
to_string
(),
'INVALID_ARGUMENT: �'
)
self
.
assertEqual
(
str
(
stx80
),
'INVALID_ARGUMENT: �'
)
e
=
status
.
StatusNotOk
(
stx80
)
...
...
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