[python-win32] TypeError: PyTime cannot be compared to other types
Mark Hammond
skippy.hammond at gmail.com
Sun Mar 15 23:45:24 CET 2009
On 14/03/2009 2:39 AM, Randy Syring wrote:
> I have a Python script that interacts with Excel files through COM. In
> one section of the code, I do a loop that compares values:
>
> def find_row(self, sheet, needle, column, start=1, end=100):
> for x in range(start, end+1):
> if sheet.Range('%s%s' % (column, x)).Value == needle:
> return x
> raise ValueNotFound
>
> In build 212, this worked fine. However, with build 213, I am now
> getting the exception:
>
> ", line 170, in find_row
> if sheet.Range('%s%s' % (column, x)).Value == needle:
> TypeError: PyTime cannot be compared to other types
Ouch - that does look like a regression caused by the implementation of
rich comparisons. For now you should just catch and ignore that error.
Cheers,
Mark
More information about the python-win32
mailing list