Sfoglia il codice sorgente

fix python3 issue again.

tags/v0.99.beta20
Alex Foulon 9 anni fa
parent
commit
0baf2fde06
2 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. +2
    -5
      python/caca/canvas.py
  2. +2
    -1
      python/caca/display.py

+ 2
- 5
python/caca/canvas.py Vedi File

@@ -38,7 +38,7 @@ class _Canvas(object):
return "<CacaCanvas %dx%d>" % (self.get_width(), self.get_height())

def __del__(self):
if self._cv > 0:
if self._cv > 0 and _lib is not None:
self._free()

def _free(self):
@@ -47,10 +47,7 @@ class _Canvas(object):
_lib.caca_free_canvas.argtypes = [_Canvas]
_lib.caca_free_canvas.restype = ctypes.c_int

if self is not None:
return _lib.caca_free_canvas(self)

return None
return _lib.caca_free_canvas(self)

class Canvas(_Canvas):
""" Canvas object, methods are libcaca functions with canvas_t as


+ 2
- 1
python/caca/display.py Vedi File

@@ -32,7 +32,7 @@ class _Display(object):
return "<CacaDisplay>"

def __del__(self):
if self._dp > 0:
if self._dp > 0 and _lib is not None:
self._free()

def _free(self):
@@ -43,6 +43,7 @@ class _Display(object):

return _lib.caca_free_display(self)


class Display(_Display):
""" Display objects, methods are libcaca functions with display_t as first
parameter.


Caricamento…
Annulla
Salva