[PATCH] windows: fix use of undefined exception (issue1707)

Henrik Stuart hg at hstuart.dk
Thu Jun 25 13:04:25 CDT 2009


Matt Mackall wrote:
> On Thu, 2009-06-25 at 17:11 +0000, Henrik Stuart wrote:
>> # HG changeset patch
>> # User Henrik Stuart <hg at hstuart.dk>
>> # Date 1245948386 -7200
>> # Node ID 0823bdb69ce6b06d2aeea599af0f5fae2d588332
>> # Parent  bc9ac7a29a737d7b99289598d376fb0b03d2b6c2
>> windows: fix use of undefined exception (issue1707)
>>
>> This fixes the implied reliance on pywin32 and the win32 module. This
>> also fixes a regression in ae275ad46bd0 that made Mercurial unusable
>> without pywin32.
>>
>> The exception classes are needed to wrap the buffered posixfile from
>> osutil in normal IOError semantics, otherwise several uses of the file
>> opener fails in unexpected ways making it impossible to operate on
>> repositories.
>>
>> The error constants are introduced as needed from pywin32's winerror
>> module.
> 
> But are they actually needed at all? The Python docs -claim- that
> WindowsError has an appropriate errno.h set in errno? Can't we do
> something like this:

Ah, I missed that detail. Yes, the custom exception classes aren't
needed at all. The (snipped) patch you provided solves the problem.

-- 
Kind regards,
  Henrik Stuart


More information about the Mercurial-devel mailing list