One function
filter2 in pyvisa/pyvisa
The author described this change as “rname: fix conversion for VXI attribute”. It counts as a record because the check below fails on the code as it stood at 1e93d89e8 and passes on 1da80f7cd, with nothing else changed between the two runs.
Projectpyvisa/pyvisa
Fix saved2020-01-08
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Filter a list of resources according to a query expression. It accepts the optional part of the expression. .. warning: This function is experimental and unsafe as it uses eval, It also might require to open the resource. :param resources: iterable of resources. :param query: query expression. :param open_resource: function to open the resource.
The change
| 93 | 93 | if not isinstance(self.parsed, (VXIInstr, VXIBackplane)): | |
| 94 | 94 | raise self.raise_missing_attr(item) | |
| 95 | 95 | else: | |
| 96 | - | return self.parsed.vxi_logical_address | |
| 96 | + | return int(self.parsed.vxi_logical_address) | |
| 97 | 97 | ||
| 98 | 98 | if self.resource is None: | |
| 99 | 99 | self.resource = open_resource(self.resource_name) |
The check that tells the two apart
fail→pass·pyvisa/testsuite/test_rname.py::TestFilters::test_filter2_optional_clause_no_connection
Check file pyvisa/testsuite/test_rname.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it1e93d89e8ab65d8f15de0a36d30e4615ed3284ec
Broken version dated2020-01-08
Modulepyvisa.rname
Units changedfilter2
Fingerprint406b638c4d8b2bf5
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.