/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to tools/rst2prettyhtml.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    from docutils.core import publish_file
10
10
    from docutils.parsers import rst
11
11
except ImportError:
12
 
    print "Missing dependency.  Please install docutils."
 
12
    print("Missing dependency.  Please install docutils.")
13
13
    sys.exit(1)
14
14
try:
15
15
    from elementtree.ElementTree import XML
16
16
    from elementtree import HTMLTreeBuilder
17
17
except ImportError:
18
 
    print "Missing dependency.  Please install ElementTree."
 
18
    print("Missing dependency.  Please install ElementTree.")
19
19
    sys.exit(1)
20
20
try:
21
21
    import kid
22
22
except ImportError:
23
 
    print "Missing dependency.  Please install Kid."
 
23
    print("Missing dependency.  Please install Kid.")
24
24
    sys.exit(1)
25
25
 
26
26
 
46
46
def safe_open(filename, mode):
47
47
    try:
48
48
        return open(filename, mode + 'b')
49
 
    except IOError, e:
 
49
    except IOError as e:
50
50
        if e.errno != errno.ENOENT:
51
51
            raise
52
52
        sys.stderr.write('file not found: %s\n' % sys.argv[2])