From 551ad917753d7411c0b34d3f776de890c287f11d Mon Sep 17 00:00:00 2001 From: Alex Foulon Date: Thu, 18 Jun 2015 19:59:31 +0200 Subject: [PATCH] python: fix python3 problem --- python/caca/canvas.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/caca/canvas.py b/python/caca/canvas.py index 725ae49..7fc0a74 100644 --- a/python/caca/canvas.py +++ b/python/caca/canvas.py @@ -47,7 +47,10 @@ class _Canvas(object): _lib.caca_free_canvas.argtypes = [_Canvas] _lib.caca_free_canvas.restype = ctypes.c_int - return _lib.caca_free_canvas(self) + if self is not None: + return _lib.caca_free_canvas(self) + + return None class Canvas(_Canvas): """ Canvas object, methods are libcaca functions with canvas_t as