Changeset 13641


Ignore:
Timestamp:
Oct 2, 2019 1:40:25 PM (2 months ago)
Author:
randersson
Message:

#5819 Moved the conversion of type of the keys to parser.py -> startElement(...) because it is the entry point for xml package. This change is based on the difference between python2 and python3, where the keys in python2 would be added with type unicode, while python3 adds the keys with type str.

Location:
branches/dev-5819/Python/src/pyjmi/log
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-5819/Python/src/pyjmi/log/parser.py

    r13596 r13641  
    111111       
    112112        key = attrs.get('name')
     113        # convert to string if key is not None
     114        # because Python 2.x returns unicode while Python 3.x does not
     115        key = key if not key else str(key)
    113116
    114117        self.chars = []
  • branches/dev-5819/Python/src/pyjmi/log/tree.py

    r13597 r13641  
    6161    def __repr__(self):
    6262        return ('<' + self.type + ' node with ' + repr(len(self.nodes))
    63                 + ' subnodes, and named subnodes ' + repr(list(map(str, self.dict.keys()))) + '>')
     63                + ' subnodes, and named subnodes ' + repr(list(self.dict.keys())) + '>')
    6464
    6565
Note: See TracChangeset for help on using the changeset viewer.