-
Notifications
You must be signed in to change notification settings - Fork 44
DevEncoded attribute should produce a bytes object in python 3 #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a quick fix! Thanks for adding a test so we can see that it works. Just some minor notes, but looks good.
ext/device_attribute.cpp
Outdated
py_value.attr(value_attr_name) = | ||
bopy::make_tuple(r_encoded_format, r_encoded_data); | ||
|
||
boost::python::object r_encoded_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but this line's indentation looks different to the others in the github view. Maybe hard tab vs soft tab issue?
ext/device_attribute.cpp
Outdated
bopy::make_tuple(r_encoded_format, r_encoded_data); | ||
|
||
boost::python::object r_encoded_data( | ||
boost::python::handle<>(PyBytes_FromStringAndSize( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other parts of this file with similar code uses bopy::handle<>
, rather than boost::python::handle<>
. E.g.
pytango/ext/device_attribute.cpp
Line 186 in 5945e17
bopy::object w_encoded_data = bopy::object(bopy::handle<>(w_encoded_data_ptr)); |
I don't know what either do, so just checking if it makes a difference?
ext/device_attribute.cpp
Outdated
bopy::str w_encoded_data(w_ch_ptr, w_encoded_data_array.length()); | ||
py_value.attr(w_value_attr_name) = | ||
|
||
boost::python::object w_encoded_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation differs here too.
tests/test_server.py
Outdated
|
||
@attr.write | ||
def attr(self, value): | ||
print(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this print still useful, or was it just to aid debugging?
@ajoubertza Thanks for the review, it's all fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@ajoubertza Feel free to merge it then :) |
Fix issue #213.