Commit Graph

5 Commits

Author SHA1 Message Date
Yuya Nishihara
17d165938d mpatch: raise MemoryError instead of mpatchError if lalloc() failed
MemoryError is handled differently in dispatch._runcatch().

Since mpatch_errors[] isn't that useful now, I've changed it to a simple
switch statement.
2016-08-07 10:06:56 +09:00
Yuya Nishihara
8a3d71403a mpatch: silence warning about maybe-uninitialized variable
It's false positive, but it wouldn't be possible for gcc to know
PyBytes_FromStringAndSize() sets PyErr_Occurred().

  mercurial/mpatch_module.c:105:47: warning: 'r' may be used uninitialized
  in this function [-Wmaybe-uninitialized]
     PyErr_SetString(mpatch_Error, mpatch_errors[-r]);
2016-08-07 09:47:07 +09:00
Yuya Nishihara
932006e32f mpatch: remove superfluous whitespaces 2016-08-07 09:49:07 +09:00
Maciej Fijalkowski
8d7ca5fe20 mpatch: remove dependency on Python.h in mpatch.c
Now all the CPython-related stuff are referenced only from
mpatch_module.c with mpatch.c being freely usable from
a future cffi module
2016-07-22 17:28:05 +02:00
Maciej Fijalkowski
3bdeeb5959 mpatch: split mpatch into two files 2016-07-18 19:02:30 +02:00