channel: Fix to-physical setup in AnalogChannel._get_converter
authorW. Trevor King <wking@tremily.us>
Thu, 17 Jan 2013 14:00:20 +0000 (09:00 -0500)
committerW. Trevor King <wking@tremily.us>
Thu, 17 Jan 2013 14:00:20 +0000 (09:00 -0500)
This fixes a bug introduced by

  commit ac38a7987800c3982ac363af5b7780885c88d3a1
  Author: W. Trevor King <wking@tremily.us>
  Date:   Fri Oct 19 09:53:22 2012 -0400

    calibration: support to-physical-only softcal boards.

where the converter's _from_physical was only initialized if there was
an error trying to determine its value.  Obviously, we should only be
initializing it if there *wasn't* an error.

pycomedi/channel.pyx

index 68520f3980992a59441928209f7a6558aca90e99..b111da9db6b5fc1e451119e29bf0d7988d44e659 100644 (file)
@@ -441,7 +441,7 @@ cdef class AnalogChannel (Channel):
                 _constant.CONVERSION_DIRECTION.from_physical)
         ret = _CalibratedConverter(from_physical_error=from_physical_error)
         ret._to_physical = to_physical
-        if from_physical_error is not None:
+        if from_physical_error is None:
             ret._from_physical = from_physical
         return ret