summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2021-10-24 13:26:39 -0400
committerLeonard Richardson <leonardr@segfault.org>2021-10-24 13:26:39 -0400
commitdd8aa7237b88569c99e85b300b0cf537aeaebfbd (patch)
treea6923b9558dab70df4de12ccbef0e0612ad909a6 /bs4/__init__.py
parentf7ec284182f3e78974fcdc7b62c88a5c3a6dbbbd (diff)
Used a warning to formally deprecate the 'text' argument in favor of 'string'.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 2a436d3..2cdfed5 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -207,10 +207,10 @@ class BeautifulSoup(Tag):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
- 'has been renamed to "%s."' % (old_name, new_name))
- value = kwargs[old_name]
- del kwargs[old_name]
- return value
+ 'has been renamed to "%s."' % (old_name, new_name),
+ DeprecationWarning
+ )
+ return kwargs.pop(old_name)
return None
parse_only = parse_only or deprecated_argument(
@@ -782,7 +782,9 @@ class BeautifulStoneSoup(BeautifulSoup):
kwargs['features'] = 'xml'
warnings.warn(
'The BeautifulStoneSoup class is deprecated. Instead of using '
- 'it, pass features="xml" into the BeautifulSoup constructor.')
+ 'it, pass features="xml" into the BeautifulSoup constructor.',
+ DeprecationWarning
+ )
super(BeautifulStoneSoup, self).__init__(*args, **kwargs)