1 |
Tolerate broken or missing xml support in python. |
2 |
This reverts a behavior change from commit |
3 |
935c47d972d986f1822850618442c19c97e300c3. |
4 |
|
5 |
Fixes: 935c47d972d9 ("lib/portage/xml/metadata.py: fix ungrouped-imports w/refactor") |
6 |
Bug: https://bugs.gentoo.org/736912 |
7 |
Signed-off-by: Zac Medico <zmedico@g.o> |
8 |
--- |
9 |
lib/portage/xml/metadata.py | 5 ++++- |
10 |
1 file changed, 4 insertions(+), 1 deletion(-) |
11 |
|
12 |
diff --git a/lib/portage/xml/metadata.py b/lib/portage/xml/metadata.py |
13 |
index 808ba2246..875cc4044 100644 |
14 |
--- a/lib/portage/xml/metadata.py |
15 |
+++ b/lib/portage/xml/metadata.py |
16 |
@@ -34,7 +34,10 @@ __all__ = ('MetaDataXML', 'parse_metadata_use') |
17 |
import re |
18 |
import xml.etree.ElementTree as etree |
19 |
|
20 |
-from xml.parsers.expat import ExpatError |
21 |
+try: |
22 |
+ from xml.parsers.expat import ExpatError |
23 |
+except Exception: |
24 |
+ ExpatError = SyntaxError |
25 |
|
26 |
from portage import _encodings, _unicode_encode |
27 |
from portage.util import cmp_sort_key, unique_everseen |
28 |
-- |
29 |
2.25.3 |