# HG changeset patch # User Luke Macken # Date 1267388014 18000 # Branch trunk # Node ID e345866e4e9bb259d949743234f0e787e686a96c # Parent 79a0af7a68328b3b0f0ff7e1ab319d5c19fd3a86 Remove a ternary operation in the Mapper to get it working on Python 2.4 diff --git a/routes/mapper.py b/routes/mapper.py --- a/routes/mapper.py +++ b/routes/mapper.py @@ -388,17 +388,17 @@ class Mapper(SubMapperParent): config = request_config() config.mapper = self def __str__(self): """Generates a tabular string representation.""" def format_methods(r): if r.conditions: method = r.conditions.get('method', '') - return method if type(method) is str else ', '.join(method) + return type(method) is str and method or ', '.join(method) else: return '' table = [('Route name', 'Methods', 'Path')] + \ [(r.name or '', format_methods(r), r.routepath or '') for r in self.matchlist] widths = [max(len(row[col]) for row in table)