Skip to content

Commit

Permalink
Merge pull request #995 from ar45/fix_system_error_init_container_failed
Browse files Browse the repository at this point in the history
set PyErr when Container.__init__ fails
  • Loading branch information
Christian Brauner committed May 1, 2016
2 parents b4e73f4 + 9dfb0ad commit 25e032f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python-lxc/lxc.c
Expand Up @@ -449,7 +449,9 @@ Container_init(Container *self, PyObject *args, PyObject *kwds)
self->container = lxc_container_new(name, config_path);
if (!self->container) {
Py_XDECREF(fs_config_path);
fprintf(stderr, "%d: error creating container %s\n", __LINE__, name);

PyErr_Format(PyExc_RuntimeError, "%s:%s:%d: error during init for container '%s'.",
__FUNCTION__, __FILE__, __LINE__, name);
return -1;
}

Expand Down

0 comments on commit 25e032f

Please sign in to comment.