Changeset 13494


Ignore:
Timestamp:
Sep 16, 2019 1:33:34 PM (3 months ago)
Author:
randersson
Message:

#5819 Adding conditional expression into constructors of Comment and Node to test if py2 and py3 compatibility.

File:
1 edited

Legend:

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

    r13461 r13494  
    2020Each node is represented as a Node, Comment, or leaf (other types)
    2121"""
     22from sys import version_info
    2223
    2324class Comment(object):
     
    2829    """
    2930    def __init__(self, text):
    30         assert isinstance(text, str)
     31        assert isinstance(text, str if version_info > (3, 0) else basestring)
    3132        self.text = text
    3233
     
    4344
    4445    def __init__(self, type):
    45         assert isinstance(type, str)
     46        assert isinstance(type, str if version_info > (3, 0) else basestring)
    4647        self.type  = type
    4748        self.nodes = []
Note: See TracChangeset for help on using the changeset viewer.