summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 34a72e4..b74acee 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -77,7 +77,7 @@ class BeautifulSoup(Tag):
ASCII_SPACES = '\x20\x0a\x09\x0c\x0d'
- NO_PARSER_SPECIFIED_WARNING = 'Parser was not explicitly specified. Using the best available parser for this system ("%s"). The same code on other systems may use a different parser and behave differently.'
+ NO_PARSER_SPECIFIED_WARNING = "No parser was explicitly specified, so I'm using the best available parser for this system (\"%(parser)s\"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.\n\nTo get rid of this warning, change this:\n\n BeautifulSoup([your markup])\n\nto this:\n\n BeautifulSoup([your markup], \"%(parser)s\")\n"
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, **kwargs):
@@ -155,9 +155,9 @@ class BeautifulSoup(Tag):
% ",".join(features))
builder = builder_class()
if not (original_features == builder.NAME or
- (not isinstance(builder.NAME, basestring) and
- original_features in builder.NAME)):
- warnings.warn(self.NO_PARSER_SPECIFIED_WARNING % builder.NAME)
+ original_features in builder.ALTERNATE_NAMES):
+ warnings.warn(self.NO_PARSER_SPECIFIED_WARNING % dict(
+ parser=builder.NAME))
self.builder = builder
self.is_xml = builder.is_xml