File: 01_Python2.6_reserved_words.patch

package info (click to toggle)
pyscript 0.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,428 kB
  • ctags: 1,175
  • sloc: python: 10,146; makefile: 67
file content (37 lines) | stat: -rw-r--r-- 1,384 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
Description: Do not use "as" as variable name, it's a reserved word in Python 2.6 and newer
Origin: Ubuntu
Bug-Ubuntu: #392870

diff -Nur -x '*.orig' -x '*~' pyscript-0.6.1/pyscript/groups.py pyscript-0.6.1.new/pyscript/groups.py
--- pyscript-0.6.1/pyscript/groups.py	2006-02-28 18:16:58.000000000 +0000
+++ pyscript-0.6.1.new/pyscript/groups.py	2009-06-27 14:29:26.000000000 +0000
@@ -387,10 +387,10 @@
     assert a2 in ["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]
 
     # note the swap:
-    as = options.get('as', a2)
+    _as = options.get('as', a2)
     ae = options.get('ae', a1)
 
-    assert as in ["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]
+    assert _as in ["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]
     assert ae in ["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]
 
     # these two have to be present
@@ -424,14 +424,14 @@
 
         # place items at the edges
         # ---first object----
-        ov = getattr(items[0].bbox(), as)-p1
+        ov = getattr(items[0].bbox(), _as)-p1
 
         # how much we need to move by
         mv = -pv.U*ov*pv.U
         items[0].move(mv)
 
         space -= abs(( getattr(items[0].bbox(), a1)
-                         - getattr(items[0].bbox(), as) )*pv.U)
+                         - getattr(items[0].bbox(), _as) )*pv.U)
 
         # ---second object---
         ov = getattr(items[-1].bbox(), ae)-p2