summaryrefslogtreecommitdiff
blob: 2b606a1c5613567f9ce3a93ad5dd489b37ec3b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
This patch is probably incomplete.

--- src/lxml/html/_diffcommand.py
+++ src/lxml/html/_diffcommand.py
@@ -34,7 +34,7 @@
     if options.annotation:
         return annotate(options, args)
     if len(args) != 2:
-        print 'Error: you must give two files'
+        print('Error: you must give two files')
         parser.print_help()
         sys.exit(1)
     file1, file2 = args
@@ -82,6 +82,6 @@
     return pre, html, post
 
 def annotate(options, args):
-    print "Not yet implemented"
+    print("Not yet implemented")
     sys.exit(1)
     
--- src/lxml/html/_html5builder.py
+++ src/lxml/html/_html5builder.py
@@ -6,6 +6,7 @@
 
 from html5lib.treebuilders import _base, etree as etree_builders
 from lxml import html, etree
+from sys import hexversion
 
 
 class DocumentType(object):
@@ -77,7 +78,11 @@
                                                   self.doctype.systemId))
             buf.append('>')
         buf.append('<html></html>')
-        root = html.fromstring(u''.join(buf))
+        if hexversion >= 0x3000000:
+            joining_str = ''
+        else:
+            joining_str = ''.decode()
+        root = html.fromstring(joining_str.join(buf))
 
         # Append the initial comments:
         for comment in self.initialComments: