Modify ↓
Opened 14 years ago
Closed 14 years ago
#8667 closed enhancement (fixed)
[Patch] Compatibility with Python 2.4
Reported by: | Jun Omae | Owned by: | François Granade |
---|---|---|---|
Priority: | normal | Component: | TicketImportPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
The TicketImportPlugin is very usable and excellent, however, the plugin does not work with Python 2.4 on CentOS 5.5.
$ python2.4 Python 2.4.3 (#1, Nov 11 2010, 13:34:43) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import talm_importer.importer Traceback (most recent call last): File "<stdin>", line 1, in ? File "/home/jun66j5/src/ticketimportplugin.git/talm_importer/__init__.py", line 8, in ? from talm_importer.importer import * File "talm_importer/importer.py", line 310 ticket_id = int(row[idcolumn]) if row[idcolumn] else 0 ^ SyntaxError: invalid syntax
Because the plugin uses new syntax ... if ... else ...
since Python 2.5.
Please apply the following patch, if you can.
-
talm_importer/importer.py
diff --git a/talm_importer/importer.py b/talm_importer/importer.py index bc7afa6..7b820d4 100644
a b class ImportModule(Component): 307 307 308 308 for row in rows: 309 309 if idcolumn: 310 ticket_id = int(row[idcolumn] ) if row[idcolumn] else 0310 ticket_id = int(row[idcolumn] or 0) 311 311 if ticket_id: 312 312 self._check_ticket(db, ticket_id) 313 313 else:
Attachments (0)
Note: See
TracTickets for help on using
tickets.
Thanks - good catch - committed in [10018]