tlecomte / friture

Real-time audio visualizations (spectrum, spectrogram, etc.)
http://friture.org
GNU General Public License v3.0
937 stars 161 forks source link

Python 3.10 support (automatic float truncation) #204

Closed mamins1376 closed 2 years ago

mamins1376 commented 2 years ago

I recently upgraded my system (arch btw :) which ships python 3.10, and apparently due to a deprecation, this happens now:

  File "/usr/bin/friture", line 10, in <module>
    main()
  File "/usr/lib/python3.10/site-packages/friture/analyzer.py", line 395, in main
    window = Friture()
  File "/usr/lib/python3.10/site-packages/friture/analyzer.py", line 128, in __init__
    self.level_widget = Levels_Widget(self, self.qml_engine)
  File "/usr/lib/python3.10/site-packages/friture/levels.py", line 69, in __init__
    self.onWidthChanged()
  File "/usr/lib/python3.10/site-packages/friture/levels.py", line 108, in onWidthChanged
    self.quickWidget.setFixedWidth(self.qmlObject.width())
TypeError: setFixedWidth(self, int): argument 1 has unexpected type 'float'

There are many places in the code other than this one which relies on the mentioned behavior, but a simple x to int(x) replacement should fix the issue.