Update qiskit.utils.wrap_method
for Python 3.11
#9310
Merged
qiskit.utils.wrap_method
for Python 3.11
#9310