Fix #5007 Handle version str with extra info #5008
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Packaging 22 dropped LegacyVersion. We mostly handled this by converting any letters in the version str to a number using ord. However, the version str for keysight also contained extra info and looks something like this "A.02.17-02.40-02.17-00.52-04-01"
From packaging 22 and upwards this is an error. We fix that by splitting on
-
and only using the first part. The converter is only used for Keysight versions so adding it there seems safe.This was not caught in the Keysight 34xxx driver tests since the test only runs for a simulated instrument that has the dig option marked installed and this path in the code is only taken if the dig option is not present in the options str.
Extend the tests for the converter to
fixes #5007