blob: 0dc9c78f0f166f71ea2492d4c39d0c0d0b776b99 [file] [log] [blame]
Piotr Krysikea34c012016-10-02 18:53:43 +02001#!/usr/bin/env python2
2# -*- coding: utf-8 -*-
3# @file
Piotr Krysika6268a52017-08-23 16:02:19 +02004# @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com>
Piotr Krysikea34c012016-10-02 18:53:43 +02005# @section LICENSE
6#
7# Gr-gsm is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3, or (at your option)
10# any later version.
11#
12# Gr-gsm is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with gr-gsm; see the file COPYING. If not, write to
19# the Free Software Foundation, Inc., 51 Franklin Street,
20# Boston, MA 02110-1301, USA.
21#
22
Piotr Krysik8715da02016-01-06 22:21:09 +010023from gnuradio import gr
24from distutils.version import LooseVersion as version
25
26#class created to solve incompatibility of reginstration of message inputs
27#that was introduced in gnuradio 3.7.9
28
29class hier_block(gr.hier_block2):
30 def message_port_register_hier_in(self, port_id):
31 if version(gr.version()) >= version('3.7.9'):
32 super(hier_block, self).message_port_register_hier_in(port_id)
33 else:
34 super(hier_block, self).message_port_register_hier_out(port_id)
35
36 def message_port_register_hier_out(self, port_id):
37 if version(gr.version()) >= version('3.7.9'):
38 super(hier_block, self).message_port_register_hier_out(port_id)
39 else:
40 super(hier_block, self).message_port_register_hier_in(port_id)
41