summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-03-01 17:39:55 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-03-01 17:39:55 -0500
commit8333c2b5bfd78dfcc9544403a6e1d285f587475b (patch)
tree2bc9399b5a9a544cc0e5561516542365c4061c6e /bs4/__init__.py
parentad95318eb882a55a7a4bb692defdce8dee487cb6 (diff)
For backwards compatibility, brought back the BeautifulStoneSoup class as a deprecated wrapper around BeautifulSoup.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 7a36493..c66cc65 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -329,6 +329,16 @@ class BeautifulSoup(Tag):
return prefix + super(BeautifulSoup, self).decode(
indent_level, eventual_encoding, formatter)
+class BeautifulStoneSoup(BeautifulSoup):
+ """Deprecated interface to an XML parser."""
+
+ def __init__(self, *args, **kwargs):
+ kwargs['features'] = 'xml'
+ warnings.warn(
+ 'The BeautifulStoneSoup class is deprecated. Instead of using '
+ 'it, pass features="xml" into the BeautifulSoup constructor.')
+ super(BeautifulStoneSoup, self).__init__(*args, **kwargs)
+
class StopParsing(Exception):
pass