From ed91bd6f5db77a911e551e7bb0b4cf2ed585614b Mon Sep 17 00:00:00 2001 From: Rinke Hoekstra Date: Tue, 4 Nov 2014 13:54:46 +0100 Subject: [PATCH] Extra brackets Need to have brackets around equality checks to prevent the index of the array `string` to be out of range. --- rdflib/plugins/parsers/pyRdfa/host/html5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdflib/plugins/parsers/pyRdfa/host/html5.py b/rdflib/plugins/parsers/pyRdfa/host/html5.py index 7420c1b43..9f08d8bc9 100644 --- a/rdflib/plugins/parsers/pyRdfa/host/html5.py +++ b/rdflib/plugins/parsers/pyRdfa/host/html5.py @@ -82,7 +82,7 @@ def _format_test(string) : # Now come the special cases:-( # Check first for the duration stuff, that is the nastiest. - if len(string) > 2 and string[0] == 'P' or (string [0] == '-' and string[1] == 'P') : + if len(string) > 2 and (string[0] == 'P' or (string[0] == '-' and string[1] == 'P')) : # this is meant to be a duration type # first of all, get rid of the leading '-' and check again if string[0] == '-' :