chiark / gitweb /
checkupdates: use html.unescape instead of HTMLParser.unescape
authorMarcus Hoffmann <bubuiic@aol.com>
Tue, 12 Sep 2017 23:42:15 +0000 (01:42 +0200)
committerMarcus Hoffmann <bubuiic@aol.com>
Tue, 12 Sep 2017 23:42:15 +0000 (01:42 +0200)
HTMLParser.unescape is only an internal method and deprecated.
This requires Pyhton 3.4.

fdroidserver/checkupdates.py

index 856a514c1404330a7ead0351f097951f05f35264..217139d19a956fb052d5ac5f5365e89615ba5f49 100644 (file)
@@ -25,7 +25,7 @@ import time
 import subprocess
 from argparse import ArgumentParser
 import traceback
-from html.parser import HTMLParser
+import html
 from distutils.version import LooseVersion
 import logging
 import copy
@@ -289,8 +289,7 @@ def check_gplay(app):
 
     m = re.search('itemprop="softwareVersion">[ ]*([^<]+)[ ]*</div>', page)
     if m:
-        html_parser = HTMLParser()
-        version = html_parser.unescape(m.group(1))
+        version = html.unescape(m.group(1))
 
     if version == 'Varies with device':
         return (None, 'Device-variable version, cannot use this method')