Skip to content

Commit

Permalink
Solve a problem in python constructor of NSVCAP if no version
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mracek authored and dmach committed Aug 13, 2018
1 parent d98ac8e commit 792279b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/hawkey/nsvcap-py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ nsvcap_init(_NsvcapObject *self, PyObject *args, PyObject *kwds)
*self->nsvcap = *cNsvcap;
return 0;
}
if (!set_version(self, version_o, NULL)) {
PyErr_SetString(PyExc_TypeError, "An integer value or None expected for version.");
return -1;
if (version_o) {
if (!set_version(self, version_o, NULL)) {
PyErr_SetString(PyExc_TypeError, "An integer value or None expected for version.");
return -1;
}
}
self->nsvcap->setName(name ? name : "");
self->nsvcap->setStream(stream ? stream : "");
Expand Down

0 comments on commit 792279b

Please sign in to comment.