Make syntax of g.compute_directives_re compatible with Python 3.x.