public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Zac Medico <zmedico@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] lib/portage/xml/metadata.py: tolerate xml.parsers.expat import failures (bug 736912)
Date: Wed, 12 Aug 2020 20:41:09 -0700	[thread overview]
Message-ID: <20200813034109.52276-1-zmedico@gentoo.org> (raw)

Tolerate broken or missing xml support in python.
This reverts a behavior change from commit
935c47d972d986f1822850618442c19c97e300c3.

Fixes: 935c47d972d9 ("lib/portage/xml/metadata.py: fix ungrouped-imports w/refactor")
Bug: https://bugs.gentoo.org/736912
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 lib/portage/xml/metadata.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/portage/xml/metadata.py b/lib/portage/xml/metadata.py
index 808ba2246..875cc4044 100644
--- a/lib/portage/xml/metadata.py
+++ b/lib/portage/xml/metadata.py
@@ -34,7 +34,10 @@ __all__ = ('MetaDataXML', 'parse_metadata_use')
 import re
 import xml.etree.ElementTree as etree
 
-from xml.parsers.expat import ExpatError
+try:
+	from xml.parsers.expat import ExpatError
+except Exception:
+	ExpatError = SyntaxError
 
 from portage import _encodings, _unicode_encode
 from portage.util import cmp_sort_key, unique_everseen
-- 
2.25.3



                 reply	other threads:[~2020-08-13  3:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200813034109.52276-1-zmedico@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox