testwheel.py: Fix up the error handling


When no PySide was present, the too would error out:

testwheel.py", line 520, in <module>
   VERSION[0] = path_version
   TypeError: 'tuple' object does not support item assignment

This apparently resulted from some old code trying to determine
the version from the path.
Split out the code trying to find the root into a helper
function and reorder the code for clarity. Print out errors
to stderr.

Change-Id: I3f4e878cf3e3d09466180c65e92da98946ee6826
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
commite9f70c84c16593ee87a059edc22397f8ab8f8c77
parentc2586b65d39a35cc57180beb5021ca5ebd8f1eb0
authorFriedemann Kleint <Friedemann.Kleint@qt.io>
committerFriedemann Kleint <Friedemann.Kleint@qt.io>
commit timeTue, 25 Mar 2025 12:50:06 +0100