diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-11-06 19:23:06 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-11-06 19:23:06 +0100 |
commit | cea9faf35794930653b90e97fc35e68be013691f (patch) | |
tree | 19dd8a72fcdcb0334e139ee442a6e5933927a820 /scripts/Component.py | |
parent | Fixed Java Ubuntu/Debian IceGrid/simple test failure (diff) | |
download | ice-cea9faf35794930653b90e97fc35e68be013691f.tar.bz2 ice-cea9faf35794930653b90e97fc35e68be013691f.tar.xz ice-cea9faf35794930653b90e97fc35e68be013691f.zip |
Fixed Python debug warnings when running tests
Diffstat (limited to 'scripts/Component.py')
-rw-r--r-- | scripts/Component.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/Component.py b/scripts/Component.py index 0140155d490..4d4d10fc78c 100644 --- a/scripts/Component.py +++ b/scripts/Component.py @@ -197,17 +197,17 @@ class Ice(Component): ] def getSoVersion(self): - config = open(os.path.join(toplevel, "cpp", "include", "IceUtil", "Config.h"), "r") - intVersion = int(re.search("ICE_INT_VERSION ([0-9]*)", config.read()).group(1)) - majorVersion = int(intVersion / 10000) - minorVersion = int(intVersion / 100) - 100 * majorVersion - patchVersion = intVersion % 100 - if patchVersion < 50: - return '%d' % (majorVersion * 10 + minorVersion) - elif patchVersion < 60: - return '%da%d' % (majorVersion * 10 + minorVersion, patchVersion - 50) - else: - return '%db%d' % (majorVersion * 10 + minorVersion, patchVersion - 60) + with open(os.path.join(toplevel, "cpp", "include", "IceUtil", "Config.h"), "r") as config: + intVersion = int(re.search("ICE_INT_VERSION ([0-9]*)", config.read()).group(1)) + majorVersion = int(intVersion / 10000) + minorVersion = int(intVersion / 100) - 100 * majorVersion + patchVersion = intVersion % 100 + if patchVersion < 50: + return '%d' % (majorVersion * 10 + minorVersion) + elif patchVersion < 60: + return '%da%d' % (majorVersion * 10 + minorVersion, patchVersion - 50) + else: + return '%db%d' % (majorVersion * 10 + minorVersion, patchVersion - 60) component = Ice() |