Commit 6d4ee9791b0819b76d85d55c9d50b499e43b2b47

Authored by Wong Mun Hou
Committed by GitHub
1 parent c853b1e1

Fix NameError: unichr not defined in python3

unichr has been replaced by chr in python 3
Showing 1 changed file with 1 additions and 1 deletions
oletools/olevba3.py
... ... @@ -906,7 +906,7 @@ def vba_chr_tostr(t):
906 906 if i>=0 and i<=255:
907 907 return VbaExpressionString(chr(i))
908 908 else:
909   - return VbaExpressionString(unichr(i).encode('utf-8', 'backslashreplace'))
  909 + return VbaExpressionString(chr(i).encode('utf-8', 'backslashreplace'))
910 910 except ValueError:
911 911 log.exception('ERROR: incorrect parameter value for chr(): %r' % i)
912 912 return VbaExpressionString('Chr(%r)' % i)
... ...