Skip to content

Commit

Permalink
format: workaround Python pre-2.7 limitation (Issue5982)
Browse files Browse the repository at this point in the history
...making the test suite pass on RHEL 6 once again.

Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
jnpkrn committed Sep 4, 2014
1 parent e111578 commit c584b8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion format.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ def get_bytestring(self, protocol):
pretty_print=True)

@SimpleFormat.producing(ETREE, protect=True,
validator=etree_validator.__func__)
# pre 2.7 compat: http://bugs.python.org/issue5982
validator=etree_validator.__get__(1).im_func)
def get_etree(self, protocol):
return etree.fromstring(self.BYTESTRING()).getroottree()

0 comments on commit c584b8d

Please sign in to comment.