Commits

Anonymous committed 514dbfc

Support for changed type names in numpy >= 1.0.2
TTF change that seems to have gone un-checked-in.

Index: SDL/ttf.py
===================================================================
--- SDL/ttf.py (revision 950)
+++ SDL/ttf.py (working copy)
@@ -358,7 +358,7 @@

:rtype: `SDL_Surface`
'''
- return _TTF_RenderGlyph_Solid(font, ord(text), fg)
+ return _TTF_RenderGlyph_Solid(font, ord(ch), fg)

_TTF_RenderUTF8_Shaded = _dll.private_function('TTF_RenderUTF8_Shaded',
arg_types=[_TTF_Font, c_char_p, SDL.video.SDL_Color, SDL.video.SDL_Color],
@@ -450,7 +450,7 @@

:rtype: `SDL_Surface`
'''
- return _TTF_RenderGlyph_Blended(font, ord(text), fg)
+ return _TTF_RenderGlyph_Blended(font, ord(ch), fg)

TTF_CloseFont = _dll.function('TTF_CloseFont',
'''Close an opened font file.
Index: SDL/array.py
===================================================================
--- SDL/array.py (revision 950)
+++ SDL/array.py (working copy)
@@ -16,11 +16,20 @@
for array_name in array_names:
try:
array = __import__(array_name, globals(), locals, [])
- typemap = {
- c_ubyte: array.UInt8,
- c_ushort: array.UInt16,
- c_uint: array.UInt32
- }
+ try:
+ typemap = {
+ c_ubyte: array.UInt8,
+ c_ushort: array.UInt16,
+ c_uint: array.UInt32
+ }
+ except AttributeError:
+ # numpy 1.0.2 loses backward compatibility, only exports uint8
+ # etc.
+ typemap = {
+ c_ubyte: array.uint8,
+ c_ushort: array.uint16,
+ c_uint: array.uint32
+ }
locals[array_name] = array
locals['_%s_typemap' % array_name] = typemap
locals['_have_%s' % array_name] = True
Index: CHANGELOG
===================================================================
--- CHANGELOG (revision 950)
+++ CHANGELOG (working copy)
@@ -1,3 +1,7 @@
+SDL-ctypes 0.11 (unreleased)
+----------------------------
+ - Support for changed type names in numpy >= 1.0.2
+
Pygame-ctypes 0.10
------------------
- Fixed unset colorkey with Surface.set_colorkey
@@ -27,6 +31,7 @@
SDL-ctypes 0.10
---------------
- Mix_ChannelFinished fixed GC error.
+ - TTF_RenderGlyph* typo fixed.

Pygame-ctypes 0.09
------------------

Comments (0)

Files changed (3)

+SDL-ctypes 0.11 (unreleased)
+----------------------------
+ - Support for changed type names in numpy >= 1.0.2
+
 Pygame-ctypes 0.10
 ------------------
  - Fixed unset colorkey with Surface.set_colorkey
 SDL-ctypes 0.10
 ---------------
  - Mix_ChannelFinished fixed GC error.
+ - TTF_RenderGlyph* typo fixed.
 
 Pygame-ctypes 0.09
 ------------------
     for array_name in array_names:
         try:
             array = __import__(array_name, globals(), locals, [])
-            typemap = {
-                c_ubyte: array.UInt8,
-                c_ushort: array.UInt16,
-                c_uint: array.UInt32
-            }
+            try:
+                typemap = {
+                    c_ubyte: array.UInt8,
+                    c_ushort: array.UInt16,
+                    c_uint: array.UInt32
+                }
+            except AttributeError:
+                # numpy 1.0.2 loses backward compatibility, only exports uint8
+                # etc.
+                typemap = {
+                    c_ubyte: array.uint8,
+                    c_ushort: array.uint16,
+                    c_uint: array.uint32
+                }
             locals[array_name] = array
             locals['_%s_typemap' % array_name] = typemap
             locals['_have_%s' % array_name] = True
 
     :rtype: `SDL_Surface`
     '''
-    return _TTF_RenderGlyph_Solid(font, ord(text), fg)
+    return _TTF_RenderGlyph_Solid(font, ord(ch), fg)
 
 _TTF_RenderUTF8_Shaded = _dll.private_function('TTF_RenderUTF8_Shaded',
     arg_types=[_TTF_Font, c_char_p, SDL.video.SDL_Color, SDL.video.SDL_Color],
 
     :rtype: `SDL_Surface`
     '''
-    return _TTF_RenderGlyph_Blended(font, ord(text), fg)
+    return _TTF_RenderGlyph_Blended(font, ord(ch), fg)
 
 TTF_CloseFont = _dll.function('TTF_CloseFont',
     '''Close an opened font file.