Commits

Marcus von Appen  committed 005db42

- Avoid name conflicts with a local variable and module in
sdl2.ext.FontManager.render()

  • Participants
  • Parent commits d11faa7

Comments (0)

Files changed (2)

File sdl2/ext/font.py

         font = self.fonts[alias][size]
         text = byteify(text, "utf-8")
         if width:
-            surface = sdlttf.TTF_RenderUTF8_Blended_Wrapped(font, text,
-                                                            color, width)
+            sf = sdlttf.TTF_RenderUTF8_Blended_Wrapped(font, text, color,
+                                                       width)
         elif bg_color == pixels.SDL_Color(0, 0, 0):
-            surface = sdlttf.TTF_RenderUTF8_Blended(font, text, color)
+            sf = sdlttf.TTF_RenderUTF8_Blended(font, text, color)
         else:
-            surface = sdlttf.TTF_RenderUTF8_Shaded(font, text, color, bg_color)
-        if not surface:
+            sf = sdlttf.TTF_RenderUTF8_Shaded(font, text, color,
+                                              bg_color)
+        if not sf:
             raise SDLError(sdlttf.TTF_GetError())
-        return surface.contents
+        return sf.contents

File sdl2/ext/surface.py

 
 def subsurface(surface, area):
     """Creates a surface from a part of another surface.
-    
+
     The two surfaces share pixel data. The subsurface *must not* be used after
     its parent has been freed!
     """
                                     surface.pitch, surface_format.Rmask,
                                     surface_format.Gmask, surface_format.Bmask,
                                     surface_format.Amask)[0]
-