@@ -835,6 +835,7 @@ def renderContents(self, encoding=DEFAULT_OUTPUT_ENCODING,
835835 s .append (text )
836836 if prettyPrint :
837837 s .append ("\n " )
838+
838839 return '' .join (s )
839840
840841 #Soup methods
@@ -1226,8 +1227,8 @@ def __getattr__(self, methodName):
12261227 def isSelfClosingTag (self , name ):
12271228 """Returns true iff the given string is the name of a
12281229 self-closing tag according to this parser."""
1229- return self .SELF_CLOSING_TAGS . has_key ( name ) \
1230- or self .instanceSelfClosingTags . has_key ( name )
1230+ return name in self .SELF_CLOSING_TAGS \
1231+ or name in self .instanceSelfClosingTags
12311232
12321233 def reset (self ):
12331234 Tag .__init__ (self , self , self .ROOT_TAG_NAME )
@@ -1319,7 +1320,7 @@ def _smartPop(self, name):
13191320
13201321 nestingResetTriggers = self .NESTABLE_TAGS .get (name )
13211322 isNestable = nestingResetTriggers != None
1322- isResetNesting = self .RESET_NESTING_TAGS . has_key ( name )
1323+ isResetNesting = name in self .RESET_NESTING_TAGS
13231324 popTo = None
13241325 inclusive = True
13251326 for i in xrange (len (self .tagStack )- 1 , 0 , - 1 ):
@@ -1534,7 +1535,7 @@ class BeautifulSoup(BeautifulStoneSoup):
15341535 BeautifulStoneSoup before writing your own subclass."""
15351536
15361537 def __init__ (self , * args , ** kwargs ):
1537- if not kwargs . has_key ( 'smartQuotesTo' ) :
1538+ if 'smartQuotesTo' not in kwargs :
15381539 kwargs ['smartQuotesTo' ] = self .HTML_ENTITIES
15391540 kwargs ['isHTML' ] = True
15401541 BeautifulStoneSoup .__init__ (self , * args , ** kwargs )
0 commit comments