closes bpo-37405: Make socket.getsockname() always return a tuple for AF_CAN. (GH-14392) (GH-16018)
This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
(cherry picked from commit 954900a3f98a8c0dea14dd575490237f3f8626b3)
Co-authored-by: bggardner <brent@ebrent.net>
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 910e2bd..594a0d6 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1524,7 +1524,7 @@
#endif /* CAN_ISOTP */
default:
{
- return Py_BuildValue("O&", PyUnicode_DecodeFSDefault,
+ return Py_BuildValue("(O&)", PyUnicode_DecodeFSDefault,
ifname);
}
}