comparison roundup/hyperdb.py @ 5809:936275dfe1fa

Try to fix: DeprecationWarning: invalid escape sequence \d DeprecationWarning: invalid escape sequence \s DeprecationWarning: invalid escape sequence \) Strings under python 3 are unicode strings rather then "regular" strings as under python 2. So all regexps need to be raw strings. We will see how many I fixed and if I broke any.
author John Rouillard <rouilj@ieee.org>
date Wed, 12 Jun 2019 20:34:47 -0400
parents 0467d80eaeec
children ee2e8f8d6648
comparison
equal deleted inserted replaced
5808:bab86c874efb 5809:936275dfe1fa
1568 1568
1569 class HyperdbValueError(ValueError): 1569 class HyperdbValueError(ValueError):
1570 """ Error converting a raw value into a Hyperdb value """ 1570 """ Error converting a raw value into a Hyperdb value """
1571 pass 1571 pass
1572 1572
1573 def convertLinkValue(db, propname, prop, value, idre=re.compile('^\d+$')): 1573 def convertLinkValue(db, propname, prop, value, idre=re.compile(r'^\d+$')):
1574 """ Convert the link value (may be id or key value) to an id value. """ 1574 """ Convert the link value (may be id or key value) to an id value. """
1575 linkcl = db.classes[prop.classname] 1575 linkcl = db.classes[prop.classname]
1576 if not idre or not idre.match(value): 1576 if not idre or not idre.match(value):
1577 if linkcl.getkey(): 1577 if linkcl.getkey():
1578 try: 1578 try:

Roundup Issue Tracker: http://roundup-tracker.org/