diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2020-06-22 23:38:28 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-06-23 11:04:26 +0200 |
commit | 76b335dd8e4a01bd0e7d76a2be9912eeb41f36f2 (patch) | |
tree | ba6be95f8642d90fcfaf95d387f2b87450376842 /gr-utils/blocktool/core/parseheader.py | |
parent | 1e9a5be6de1efecbeddde08b39ebc1fda1a1786e (diff) |
blocktool: Monkeypatch time module for pygccxml to work under Python>=3.8
pygccxml tries to import time.clock, which was deprecated since Py3.3,
and removed in Py3.8
Thus, for these platforms:
time.clock = time.perf_counter
Diffstat (limited to 'gr-utils/blocktool/core/parseheader.py')
-rw-r--r-- | gr-utils/blocktool/core/parseheader.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gr-utils/blocktool/core/parseheader.py b/gr-utils/blocktool/core/parseheader.py index ef5d6d36ef..ac7f437961 100644 --- a/gr-utils/blocktool/core/parseheader.py +++ b/gr-utils/blocktool/core/parseheader.py @@ -18,6 +18,12 @@ import codecs import logging PYGCCXML_AVAILABLE = False +# ugly hack to make pygccxml work with Python >= 3.8 +import time +try: + time.clock +except: + time.clock = time.perf_counter try: from pygccxml import parser, declarations, utils PYGCCXML_AVAILABLE = True |