[chirp_devel] The End of Days - #495

Zhaofeng Li
Sat Feb 9 18:18:12 PST 2019


I've fixed the drivers to work on both Python 2 and 3, with all tests
passing. Attached is the patch.

To ensure that the behavior of get_raw(asbytes=True) is consistent
across Python 2 and 3, I've pulled in python-future which provides a
mostly-complete implementation of bytes for Python 2. This way we can
guarantee that bytes or bytes-compatible objects are returned when
new-style drivers ask for them.

Another thing that I missed is importing __futures__.division for
Python 2, again to ensure consistent behavior in 2/3.

Zhaofeng Li

On Sat, Feb 9, 2019 at 10:38 AM Dan Smith via chirp_devel
<chirp_devel at intrepid.danplanet.com> wrote:
>
> >> # HG changeset patch
> >> # User Zhaofeng Li <hello at zhaofeng.li>
> >> # Date 1549691138 28800
> >> #      Fri Feb 08 21:45:38 2019 -0800
> >> # Branch py3
> >> # Node ID 838216796b5a7e014674af9b16751cec87fb73e9
> >> # Parent  7d5cf3c3432794c5ea4b1d1d2cc65d6038d3a73b
> >> [py3] bitwise.py: Python 3-ize
> >
> >
> > Note that I've been using issue #495 to track all pure python3 conversions, as that is the earliest related issue I could find. I'll add it to your patches.
> >
> > Also, this patch breaks the settings tests on uvb5 on python2, and I want to try to keep all of those working as much as possible as that is one of the indicators of when we'll be safe to merge with the main branch.
>
> Ah, it's because a lot of places still need the __div__ you removed, especially py2. I'll add it back in and make it work like __floordiv__.
>
> --Dan
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bytes-and-stuff.patch
Type: text/x-patch
Size: 16875 bytes
Desc: not available
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20190209/b1e2f4b9/attachment-0001.bin 


More information about the chirp_devel mailing list