Patchwork win32: add comment about WinError

login
register
mail settings
Submitter Adrian Buehlmann
Date March 28, 2015, 11:45 a.m.
Message ID <f2b87f4856bfee50f6d9.1427543142@kork>
Download mbox | patch
Permalink /patch/8330/
State Accepted
Headers show

Comments

Adrian Buehlmann - March 28, 2015, 11:45 a.m.
# HG changeset patch
# User Adrian Buehlmann <adrian@cadifra.com>
# Date 1427537974 -3600
# Node ID f2b87f4856bfee50f6d970a8a7228b7ef2a2b8f5
# Parent  efa094701a05d58d505c3b0c3b3c73dba4e51e97
win32: add comment about WinError

Prevent reintroducing the bug that was added in e34106fa0dc3 (and fixed with
a2285e2fc949).
Matt Mackall - March 30, 2015, 9:20 p.m.
On Sat, 2015-03-28 at 12:45 +0100, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian@cadifra.com>
> # Date 1427537974 -3600
> # Node ID f2b87f4856bfee50f6d970a8a7228b7ef2a2b8f5
> # Parent  efa094701a05d58d505c3b0c3b3c73dba4e51e97
> win32: add comment about WinError

Queued, thanks.

Patch

diff --git a/mercurial/win32.py b/mercurial/win32.py
--- a/mercurial/win32.py
+++ b/mercurial/win32.py
@@ -279,7 +279,7 @@ 
     buf = ctypes.create_string_buffer(size + 1)
     len = _kernel32.GetModuleFileNameA(None, ctypes.byref(buf), size)
     if len == 0:
-        raise ctypes.WinError()
+        raise ctypes.WinError() # Note: WinError is a function
     elif len == size:
         raise ctypes.WinError(_ERROR_INSUFFICIENT_BUFFER)
     return buf.value