Mask range.unit with 0xff when determining the unit.
authorW. Trevor King <wking@drexel.edu>
Mon, 19 Mar 2012 14:48:36 +0000 (10:48 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 19 Mar 2012 14:48:36 +0000 (10:48 -0400)
commitd721a0c05450c793a5e0e562d286a689565cf81b
treecbccf72f2da3960837a8ff43cafd4fbb397a54f4
parent66fb4c28224ba84e8682c85cf363c7e4193dcca8
Mask range.unit with 0xff when determining the unit.

This avoids crashes like:

  Traceback (most recent call last):
    ...
    File "range.pyx", line 62, in pycomedi.range.Range.__str__
    File "range.pyx", line 70, in pycomedi.range.Range._unit_get
    File "constant.pyx", line 269, in pycomedi.constant._Enum.index_by_value
  KeyError: 256L

when RF_EXTERNAL is set.
pycomedi/range.pyx