On 3/4/15 4:46 AM, Werner wrote:
Trying to get the test_dForm.py to work.

The line failing in getStructureDescription is:
             field_structure[field_name] = (field_type, False,
                                            max(field_info[2],
field_info[3]) or None, field_info[5] or None)

The reason is that field_info[2] and field_info[3] contain None.

How to best correct this?

Werner

Traceback (most recent call last):
   File "D:\devTools\dabo - phoenix\tests\unitTests\ui\UIwx\wtc.py",
line 125, in setUp
     biz.requery()
   File "D:\devTools\dabo - phoenix\dabo\biz\dBizobj.py", line 1240, in
requery
     oldDataStructure = hash(self.DataStructure)
   File "D:\devTools\dabo - phoenix\dabo\biz\dBizobj.py", line 2851, in
_getDataStructure
     return self._CurrentCursor.DataStructure
   File "D:\devTools\dabo - phoenix\dabo\db\dCursorMixin.py", line 2951,
in _getDataStructure
     ds = self.BackendObject.getStructureDescription(self)
   File "D:\devTools\dabo - phoenix\dabo\db\dBackend.py", line 539, in
getStructureDescription
     max(field_info[2], field_info[3]) or None, field_info[5] or None)
TypeError: unorderable types: NoneType() > NoneType()

In Python 2:

>>> max(0, None)
0

In Python 3.4:
>>> max(0, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: NoneType() > int()

I was going to say we should use six to help the transition between 2 and 3 but see that six doesn't solve this issue for us.

You need to rewrite that to take into account None being a possible value in [2] or [3] (order None as less than everything). That will be cross compatible.

Paul



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to