Commit aa3ef75491b2ea0a1162230e352c6bbeeb3ab74d

Authored by Philippe Lagadec
Committed by GitHub
2 parents 6110c8aa 6d4ee979

Merge pull request #320 from mhwong2007/patch-1

Fix NameError: unichr not defined in python3
Showing 1 changed file with 1 additions and 1 deletions
oletools/olevba3.py
@@ -909,7 +909,7 @@ def vba_chr_tostr(t): @@ -909,7 +909,7 @@ def vba_chr_tostr(t):
909 if i>=0 and i<=255: 909 if i>=0 and i<=255:
910 return VbaExpressionString(chr(i)) 910 return VbaExpressionString(chr(i))
911 else: 911 else:
912 - return VbaExpressionString(unichr(i).encode('utf-8', 'backslashreplace')) 912 + return VbaExpressionString(chr(i).encode('utf-8', 'backslashreplace'))
913 except ValueError: 913 except ValueError:
914 log.exception('ERROR: incorrect parameter value for chr(): %r' % i) 914 log.exception('ERROR: incorrect parameter value for chr(): %r' % i)
915 return VbaExpressionString('Chr(%r)' % i) 915 return VbaExpressionString('Chr(%r)' % i)