Package: aap
Version: 1.072-1.1
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch jaunty

[This was originally filed as
https://bugs.launchpad.net/ubuntu/+source/aap/+bug/356442.]

'as' is a keyword in Python 2.6, and so aap fails to build. Here's an
example build log from a test rebuild we did in Ubuntu:

  
http://launchpadlibrarian.net/24879118/buildlog_ubuntu-jaunty-i386.aap_1.072-1.1_FAILEDTOBUILD.txt.gz

Judging from the nearby 'ae', it appears that 'as' is being used as an
abbreviation for 'argument start', paired with 'argument end'. Thus, I
suggest using 'ab' instead for 'argument begin'. I've attached a patch.

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]
  * Filetype.py: Rename 'as' local variable to 'ab' (argument begin), since
    'as' is a keyword in Python 2.6.

--- aap-1.072.orig/Filetype.py
+++ aap-1.072/Filetype.py
@@ -1414,12 +1414,12 @@
             rline = items[1]
         rline_len = len(rline)
         # isolate first argument, which may be in quotes
-        as = 0
-        if as < rline_len:
-            if rline[as] == '"' or rline[as] == "'":
-                quote = rline[as]
-                as = as + 1
-                ae = as
+        ab = 0
+        if ab < rline_len:
+            if rline[ab] == '"' or rline[ab] == "'":
+                quote = rline[ab]
+                ab = ab + 1
+                ae = ab
                 while ae < rline_len and rline[ae] != quote:
                     ae = ae + 1
                 if ae == rline_len:
@@ -1427,11 +1427,11 @@
                                            % (line_idx + recipe_line_nr, line))
                 n = ae + 1
             else:
-                ae = as
+                ae = ab
                 while ae < rline_len and rline[ae] != ' ' and rline[ae] != '\t':
                     ae = ae + 1
                 n = ae
-            arg1 = rline[as:ae]
+            arg1 = rline[ab:ae]
         else:
             arg1 = ''
             n = rline_len

Reply via email to