Commit 34c81ff3e9721a8aa9fb5bac6939139a8239aa1e
1 parent
46c42d92
Adapt to Python 3.0
Showing
1 changed file
with
6 additions
and
2 deletions
cscripts/csfootprint.py
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | # ========================================================================== |
3 | 3 | # Carbon footprint report script |
4 | 4 | # |
5 | -# Copyright (C) 2022 Juergen Knoedlseder | |
5 | +# Copyright (C) 2022-2023 Juergen Knoedlseder | |
6 | 6 | # |
7 | 7 | # This program is free software: you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
... | ... | @@ -627,7 +627,11 @@ class csfootprint(ctools.cscript): |
627 | 627 | title='ctools calls', ylabel='calls') |
628 | 628 | |
629 | 629 | # Kludge to adapt pie plotting to matplotlib version |
630 | - args, _, _, _ = inspect.getargspec(plt.pie) | |
630 | + ver = sys.version.split()[0] | |
631 | + if ver >= '3.0.0': | |
632 | + args, _, _, _, _, _, _ = inspect.getfullargspec(plt.pie) | |
633 | + else: | |
634 | + args, _, _, _ = inspect.getargspec(plt.pie) | |
631 | 635 | |
632 | 636 | # Plot pie figures |
633 | 637 | self._plot_pie(ax10, statistics, quantity='gCO2e', title='Footprint', args=args) | ... | ... |