Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kiva/quartz/ABCGI.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ cdef class CGImageFile(CGImage):

data = self.bmp_array.data
s = piltostring(img)
py_data = PyString_AsString(s)
py_data = PyBytes_AsString(s)

memcpy(<void*>data, <void*>py_data, len(s))

Expand Down Expand Up @@ -2766,7 +2766,7 @@ cdef CTLineRef _create_ct_line(object the_string, CTFontRef font, object stroke_
return NULL

the_string = the_string.encode('utf-8')
c_string = PyString_AsString(the_string)
c_string = PyBytes_AsString(the_string)

cf_string = CFStringCreateWithCString(NULL, c_string, kCFStringEncodingUTF8)
cf_attr_string = CFAttributedStringCreateMutable(NULL, 0)
Expand Down
2 changes: 1 addition & 1 deletion kiva/quartz/Python.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ctypedef void (*cobject_destr)(void *)
cdef extern from "Python.h":
ctypedef int size_t
ctypedef int Py_ssize_t
char* PyString_AsString(object string)
char* PyBytes_AsString(object string)
object PyString_FromString(char* c_string)
object PyString_FromStringAndSize(char* v, Py_ssize_t len)
int PyString_AsStringAndSize(object obj, char **buffer, Py_ssize_t *length)
Expand Down
10 changes: 10 additions & 0 deletions kiva/tests/test_macport.py → kiva/tests/test_quartz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
from traitsui.tests._tools import skip_if_not_wx


def test_quartz_importable():
if sys.platform != 'darwin':
from unittest.case import SkipTest
raise SkipTest("quartz is only built on OS X")

from kiva.quartz import ABCGI
from kiva.quartz import CTFont
from kiva.quartz import mac_context


@skip_if_not_wx
def test_macport():
if sys.platform != 'darwin':
Expand Down