diff -Nru a/cal3d/model.pyx b/cal3d/model.pyx --- a/cal3d/model.pyx 2008-07-27 12:36:00.000000000 +0200 +++ b/cal3d/model.pyx 2016-08-29 08:17:28.532373042 +0200 @@ -47,7 +47,7 @@ for y from 0 <= y < height: data2[y * line_length : (y + 1) * line_length] = data[(height - y - 1) * line_length : (height - y) * line_length] - return Image(data2.tostring(), width, height, nb_colors) + return Image(data2.tobytes(), width, height, nb_colors) def parse_cal3d_cfg_file(filename): """Reads a the Cal3D .cfg file, and creates and returns a Cal3D model from it.""" diff -Nru a/model/image.pyx b/model/image.pyx --- a/model/image.pyx 2009-04-25 23:44:40.000000000 +0200 +++ b/model/image.pyx 2016-08-29 08:20:40.106907620 +0200 @@ -43,7 +43,7 @@ image.nb_color = 1 image.palette = pil_image.palette.palette else: raise ValueError("unknown image mode (%s)" % pil_image.mode) - image.pixels = pil_image.tostring() + image.pixels = pil_image.tobytes() return image def screenshot(filename = None, int x = 0, int y = 0, int width = 0, int height = 0, use_back_buffer=False):