Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 6bf443e

Browse files
committed
Merge pull request #88 from asottile/fix_segfault_on_keyboardinterrupt
Fix segfault on ^C. Resolves #87.
2 parents 0d4cf15 + 0287a16 commit 6bf443e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pysass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ static union Sass_Value* _exception_to_sass_error() {
278278
PyObject* evalue = NULL;
279279
PyObject* etb = NULL;
280280
PyErr_Fetch(&etype, &evalue, &etb);
281+
PyErr_NormalizeException(&etype, &evalue, &etb);
281282
{
282283
PyObject* traceback_mod = PyImport_ImportModule("traceback");
283284
PyObject* traceback_parts = PyObject_CallMethod(
@@ -296,6 +297,9 @@ static union Sass_Value* _exception_to_sass_error() {
296297
Py_DECREF(result);
297298
Py_DECREF(bytes);
298299
}
300+
Py_DECREF(etype);
301+
Py_DECREF(evalue);
302+
Py_DECREF(etb);
299303
return retv;
300304
}
301305

0 commit comments

Comments
 (0)