From: Andreas Hansson Date: Wed, 21 Mar 2012 23:02:03 +0000 (-0400) Subject: Python: Fix a conditional expression that requires Python 2.5 X-Git-Tag: stable_2012_06_28~161 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12742835bc8e569b74efb396ef211d7b581ae3b8;p=gem5.git Python: Fix a conditional expression that requires Python 2.5 This patch changes a conditional expression to a conventional if/else block, which does not require Python >= 2.5. --- diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index a447d96db..8c14be287 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -993,8 +993,12 @@ class SimObject(object): port_names.sort() for port_name in port_names: port = self._port_refs.get(port_name, None) + if port != None: + port_count = len(port) + else: + port_count = 0 setattr(cc_params, 'port_' + port_name + '_connection_count', - len(port) if port != None else 0) + port_count) self._ccParams = cc_params return self._ccParams