Package: pyglet / 1.1.4.dfsg-2

up_no_string_exceptions Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Yaroslav Halchenko <debian@onerussian.com>
Subject: No strings exceptions is allowed in Python2.6

Types of exceptions were deduced and might be changed by upstream
whenever patch gets adopted.

Vendor: Debian

--- a/pyglet/window/carbon/__init__.py
+++ b/pyglet/window/carbon/__init__.py
@@ -655,7 +655,7 @@ class CarbonWindow(BaseWindow):
         # Can occur when mixing with other toolkits, e.g. Tk.
         # Fixes issue 180.
         if result not in (eventLoopTimedOutErr, eventLoopQuitErr):
-            raise 'Error %d' % result
+            raise WindowException('Error %d' % result)
 
     def dispatch_pending_events(self):
         while self._event_queue:
@@ -1356,7 +1356,7 @@ def _create_cfstring(text):
 
 def _oscheck(result):
     if result != noErr:
-        raise 'Carbon error %d' % result
+        raise CarbonException('Carbon error %d' % result)
     return result
 
 def _aglcheck():