Skip to content

Commit 061d7bc

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 b3bec11 commit 061d7bc

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
@@ -38,9 +38,10 @@
3838
# seen in sshd+sftpsubsys sessions. Apparently there's a bug / C-API
3939
# incompatibility when using yaml in embedded python interpreters,
4040
# due to yaml using its own nested C-extensions. In practice it
41-
# results in a metaclass conflict TypeError upon yaml re-init there
42-
# like described in
41+
# results in a metaclass conflict TypeError or SystemError upon yaml
42+
# re-init there like described in
4343
# https://github.com/ros-drivers/rosserial/issues/450
44+
# On Rocky 9 it's the TypeError and on Rocky 8 the SystemError.
4445
try:
4546
import json
4647
except ImportError:
@@ -49,7 +50,7 @@
4950
import yaml
5051
except ImportError:
5152
yaml = None
52-
except TypeError:
53+
except (TypeError, SystemError):
5354
# NOTE: this should not really happen but it does with sshd+sftpsubsys in
5455
# our PAM module hooking into this code as described above. We don't
5556
# actually need yaml in that case so just silently ignore it here and

0 commit comments

Comments
 (0)