error C2275: 'PyObject' : illegal use of this type as an expression · Issue #53 · libgit2/pygit2 · GitHub
Skip to content

error C2275: 'PyObject' : illegal use of this type as an expression #53

Description

@DK-at-FC

Installing in Windows crashes in setup.py

python setup.py install
at Microsoft Visual Studio 9.0\VC\BIN\cl.exe ...
pygit2.c(496) : error C2275: 'PyObject' : illegal use of this type as an expression

Error is caused by variable declaration in the middle of the method in Repository_read;

Fix is to move the declaration to the beginning of the method

static PyObject *
Repository_read(Repository *self, PyObject *py_hex)
{
    git_oid oid;
    int err;
    git_odb_object *obj;
    size_t len;
    PyObject* tuple; // add declaration in line 487

...

    tuple = Py_BuildValue( // Remove tuple declaration in line 497

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions