diff --git a/format.py b/format.py index 8d35789..3f8487d 100644 --- a/format.py +++ b/format.py @@ -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()