diff --git a/chains/links/transport_meta.py b/chains/links/transport_meta.py index c043842..f7761f6 100644 --- a/chains/links/transport_meta.py +++ b/chains/links/transport_meta.py @@ -3,7 +3,7 @@ # Local imports from chains.links import link -from chains.utils import file_utils, log_utils, data_utils +from chains.utils import data_utils, file_utils class TransportMeta(link.Link): @@ -39,7 +39,8 @@ def transport_meta_data(self): @staticmethod def _get_transport_type(transport): """Give the transport as a string or None if not one""" - return transport.__class__.__name__ if transport.__class__.__name__ != 'str' else None + transport_type = transport.__class__.__name__ + return transport_type if transport_type not in ('str', 'bytes', 'bytearray') else None @staticmethod def _readable_flags(transport): @@ -70,6 +71,7 @@ def _readable_flags(transport): _flag_list.append('psh') return _flag_list + def test(): """Test for TransportMeta class""" import pprint @@ -94,5 +96,6 @@ def test(): for item in tmeta.output_stream: pprint.pprint(item) + if __name__ == '__main__': test()