src/reportlab/platypus/paraparser.py
branchpy33
changeset 3937 f685e0de4282
parent 3931 ceee76b69e7c
child 3954 44dbe56eb858
equal deleted inserted replaced
3936:3b7eeda08fd9 3937:f685e0de4282
   757             except KeyError:
   757             except KeyError:
   758                 self._syntax_error('<unichar/> invalid name attribute\n"%s"' % ascii(name))
   758                 self._syntax_error('<unichar/> invalid name attribute\n"%s"' % ascii(name))
   759                 v = '\0'
   759                 v = '\0'
   760         elif 'code' in attr:
   760         elif 'code' in attr:
   761             try:
   761             try:
   762                 v = chr(int(eval(attr['code'])))
   762                 v = int(eval(attr['code']))
       
   763                 v = chr(v) if isPy3 else unichr(v)
   763             except:
   764             except:
   764                 self._syntax_error('<unichar/> invalid code attribute %s' % ascii(attr['code']))
   765                 self._syntax_error('<unichar/> invalid code attribute %s' % ascii(attr['code']))
   765                 v = '\0'
   766                 v = '\0'
   766         else:
   767         else:
   767             v = None
   768             v = None