diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2019-01-03 14:12:44 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2019-01-03 14:12:44 +0000 |
commit | 3026e912a320b987409f7e6539fe916edf1e7a8d (patch) | |
tree | 25a6924e93de2cd88d39d132f0e74e8cbc4bb279 /llvm/utils/unicode-case-fold.py | |
parent | c0606d2716f243c0921d6ff5104c43faed42bd55 (diff) | |
download | bcm5719-llvm-3026e912a320b987409f7e6539fe916edf1e7a8d.tar.gz bcm5719-llvm-3026e912a320b987409f7e6539fe916edf1e7a8d.zip |
Python compat - urllib
Differential Revision: https://reviews.llvm.org/D56261
llvm-svn: 350315
Diffstat (limited to 'llvm/utils/unicode-case-fold.py')
-rwxr-xr-x | llvm/utils/unicode-case-fold.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/utils/unicode-case-fold.py b/llvm/utils/unicode-case-fold.py index 2efa9045074..ad8265ba7bc 100755 --- a/llvm/utils/unicode-case-fold.py +++ b/llvm/utils/unicode-case-fold.py @@ -21,7 +21,11 @@ from __future__ import print_function import sys import re -import urllib2 +try: + from urllib.request import urlopen +except ImportError: + from urllib2 import urlopen + # This variable will body of the mappings function body = "" @@ -95,7 +99,7 @@ def dump_block(b): body += pattern.format(last, stride(b), modulo, shift(b[0])) current_block = [] -f = urllib2.urlopen(sys.argv[1]) +f = urlopen(sys.argv[1]) for m in mappings(f): if len(current_block) == 0: current_block.append(m) |