1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Python compat - urllib

Differential Revision: https://reviews.llvm.org/D56261

llvm-svn: 350315
This commit is contained in:
Serge Guelton 2019-01-03 14:12:44 +00:00
parent 5aaf03f132
commit 6a77c32524

View File

@ -21,7 +21,11 @@ from __future__ import print_function
import sys import sys
import re import re
import urllib2 try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
# This variable will body of the mappings function # This variable will body of the mappings function
body = "" body = ""
@ -95,7 +99,7 @@ def dump_block(b):
body += pattern.format(last, stride(b), modulo, shift(b[0])) body += pattern.format(last, stride(b), modulo, shift(b[0]))
current_block = [] current_block = []
f = urllib2.urlopen(sys.argv[1]) f = urlopen(sys.argv[1])
for m in mappings(f): for m in mappings(f):
if len(current_block) == 0: if len(current_block) == 0:
current_block.append(m) current_block.append(m)