summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-03-21 19:02:03 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-03-21 19:02:03 -0400
commit12742835bc8e569b74efb396ef211d7b581ae3b8 (patch)
treef7d3029146fe24c9848d5c2dc74b432376c221d3 /src/python
parent3c666083c6f5fecc38699a6f0c5f4f25b23e18c9 (diff)
downloadgem5-12742835bc8e569b74efb396ef211d7b581ae3b8.tar.xz
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.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/SimObject.py6
1 files changed, 5 insertions, 1 deletions
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