contrib/fuzz/pyutil.h
author Augie Fackler <augie@google.com>
Mon, 09 Dec 2019 22:20:35 -0500
changeset 43859 8766728dbce6
parent 41013 ef103c96ed33
permissions -rw-r--r--
fuzz: add support for fuzzing under either Python 2 or 3 This was more of a hairball than I hoped, but it appears to work. The hg-py3 branch of my oss-fuzz fork on github has the remaining changes to switch us to Python 3, but we may as well retain Python 2 fuzzing support for at least a little while. Differential Revision: https://phab.mercurial-scm.org/D7592

#include <Python.h>

#if PY_MAJOR_VERSION >= 3
#define PYCODETYPE PyObject
#else
#define PYCODETYPE PyCodeObject
#endif

namespace contrib
{

void initpy(const char *cselfpath);
PyObject *pyglobals();

} /* namespace contrib */