Skip to content
Snippets Groups Projects
Commit c3116de3 authored by scott snyder's avatar scott snyder
Browse files

pyAMI: python 3 fix

python 3 fix: has_key

Implemented as a patch on top of the tarfile kept in the repo.
parent 8d4bccac
No related merge requests found
......@@ -20,6 +20,8 @@ function( _setup_python_package name file md5 )
URL ${file}
URL_MD5 ${md5}
BUILD_IN_SOURCE 1
PATCH_COMMAND patch -p0 <
${CMAKE_CURRENT_SOURCE_DIR}/src/pyAMI-py3.patch
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo
"Configuring the build of ${name}"
BUILD_COMMAND
......
--- pyAMI/object.py-orig 2020-01-07 21:33:33.000000001 +0100
+++ pyAMI/object.py 2020-01-07 21:33:51.000000001 +0100
@@ -144,7 +144,7 @@
for rowset in self.rowsets:
- if not rowset_type or (rowset.attributes.has_key('type') and rowset.attributes['type'].value == rowset_type):
+ if not rowset_type or ('type' in rowset.attributes.keys() and rowset.attributes['type'].value == rowset_type):
for row in rowset.getElementsByTagName('row'):
field_dict = pyAMIDict()
@@ -152,7 +152,7 @@
for field in row.getElementsByTagName('field'):
name = field.attributes['name'].value
- if field.attributes.has_key('table'):
+ if 'table' in field.attributes.keys():
table = field.attributes['table'].value
if self.entity and table and self.entity != table:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment