Skip to content

Commit cb0604d

Browse files
committed
Manually merge PR189 to also work around the low-level bug (issue 187) with yaml used through the C-API specifically on Rocky 8. Follow-up to PR188 fixing the issue on Rocky 9.
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6205 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent d8636b9 commit cb0604d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mig/shared/serial.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
# seen in sshd+sftpsubsys sessions. Apparently there's a bug / C-API
4747
# incompatibility when using yaml in embedded python interpreters,
4848
# due to yaml using its own nested C-extensions. In practice it
49-
# results in a metaclass conflict TypeError upon yaml re-init there
50-
# like described in
49+
# results in a metaclass conflict TypeError or SystemError upon yaml
50+
# re-init there like described in
5151
# https://github.com/ros-drivers/rosserial/issues/450
52+
# On Rocky 9 it's the TypeError and on Rocky 8 the SystemError.
5253
try:
5354
import json
5455
except ImportError:
@@ -57,7 +58,7 @@
5758
import yaml
5859
except ImportError:
5960
yaml = None
60-
except TypeError:
61+
except (TypeError, SystemError):
6162
# NOTE: this should not really happen but it does with sshd+sftpsubsys in
6263
# our PAM module hooking into this code as described above. We don't
6364
# actually need yaml in that case so just silently ignore it here and

0 commit comments

Comments
 (0)