File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22from __future__ import print_function
33from roundup .anypy .strings import u2s , uchr
44
5+ import sys
6+ _pyver = sys .version_info [0 ]
57
68class dehtml :
79 def __init__ (self , converter ):
@@ -32,12 +34,10 @@ def html2text(html):
3234 # Python 3+.
3335 from html .parser import HTMLParser
3436 from html .entities import name2codepoint
35- pyver = 3
3637 except ImportError :
3738 # Python 2.
3839 from HTMLParser import HTMLParser
3940 from htmlentitydefs import name2codepoint
40- pyver = 2
4141
4242 class DumbHTMLParser (HTMLParser ):
4343 # class attribute
@@ -83,7 +83,7 @@ def handle_entityref(self, name):
8383 self .text = self .text + ' '
8484
8585 def html2text (html ):
86- if pyver == 3 :
86+ if _pyver == 3 :
8787 parser = DumbHTMLParser (convert_charrefs = True )
8888 else :
8989 parser = DumbHTMLParser ()
You can’t perform that action at this time.
0 commit comments