emory-libraries / eulxml

Utilities for using XPath to map XML data to Python objects and Django forms
http://eulxml.readthedocs.org
38 stars 12 forks source link

lexer: convert re.UNICODE to int #38

Closed cormier closed 1 year ago

cormier commented 7 years ago

Since python 3.6, RegexFlags are instances of RegexFlag, not int. Passing re.UNICODE directly to the lexer will result in the generated lextab.py returning a SyntaxError.

RegexFlag instances need to be explicitely converted to int. This solution does not break compatibility with previous previous versions of python that already return int values.

fix #35 ref: https://docs.python.org/3/library/re.html#module-contents

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.3%) to 94.2% when pulling a28476ad94b1ee0aa03ed8e46d88fe2e3abc943e on erudit:convert-regexflag-to-int into 17d71c7d98c0cebda9932b7f13e72093805e1fe2 on emory-libraries:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.3%) to 94.2% when pulling a28476ad94b1ee0aa03ed8e46d88fe2e3abc943e on erudit:convert-regexflag-to-int into 17d71c7d98c0cebda9932b7f13e72093805e1fe2 on emory-libraries:master.