mirror of
https://github.com/RPCSX/xed.git
synced 2026-01-31 01:05:17 +01:00
more replacing file(fn).readline with open(fn,r).readline...
Change-Id: Id703f961092b33ebc2703158b0706e87194021e3 (cherry picked from commit ae122603a801f87c53619df54827417f561cce5a)
This commit is contained in:
@@ -120,7 +120,7 @@ def _feature_index(all_features, f):
|
||||
|
||||
|
||||
def read_database(filename):
|
||||
lines = file(filename).readlines()
|
||||
lines = open(filename,'r').readlines()
|
||||
lines = filter_comments(lines)
|
||||
lines = genutil.process_continuations(lines)
|
||||
# returns a list and a dictionary
|
||||
|
||||
@@ -196,6 +196,6 @@ def work(lines, xeddir = '.', gendir = 'obj'):
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
lines = file(sys.argv[1]).readlines()
|
||||
lines = open(sys.argv[1],'r').readlines()
|
||||
srcs = work(lines,xeddir='.',gendir='obj')
|
||||
print("WROTE: ", "\n\t".join(srcs))
|
||||
|
||||
@@ -5696,7 +5696,7 @@ def emit_operand_storage(agi):
|
||||
|
||||
def call_ctables(agi):
|
||||
"""Conversion tables for operands"""
|
||||
lines = file(agi.common.options.ctables_input_fn).readlines()
|
||||
lines = open(agi.common.options.ctables_input_fn,'r').readlines()
|
||||
srcs = ctables.work(lines,
|
||||
xeddir=agi.common.options.xeddir,
|
||||
gendir=agi.common.options.gendir)
|
||||
|
||||
@@ -120,7 +120,7 @@ def get_memory_usage():
|
||||
"""Return a tuple of (vmsize, vmrss, vmdata) on linux systems with
|
||||
/proc filesystems."""
|
||||
try:
|
||||
lines = file('/proc/%s/status' % os.getpid()).readlines()
|
||||
lines = open('/proc/%s/status' % os.getpid(),'r').readlines()
|
||||
pairs = [ x.split(':') for x in lines]
|
||||
dct = dict(pairs)
|
||||
return (dct['VmSize'].strip(), dct['VmRSS'].strip(), dct['VmData'].strip())
|
||||
|
||||
@@ -117,7 +117,7 @@ class xed_reader_t(object):
|
||||
return widths_list
|
||||
|
||||
def _gen_widths(self, fn):
|
||||
lines = file(fn).readlines()
|
||||
lines = open(fn,'r').readlines()
|
||||
widths_list = self._refine_widths_input(lines)
|
||||
|
||||
# sets the default data type for each width
|
||||
@@ -127,7 +127,7 @@ class xed_reader_t(object):
|
||||
return widths_dict
|
||||
|
||||
def _gen_xtypes(self, fn):
|
||||
lines = file(fn).readlines()
|
||||
lines = open(fn,'r').readlines()
|
||||
xtypes_dict = opnd_types.read_operand_types(lines)
|
||||
return set(xtypes_dict.keys())
|
||||
|
||||
@@ -332,7 +332,7 @@ class xed_reader_t(object):
|
||||
|
||||
|
||||
def _parse_state_bits(self,f):
|
||||
lines = file(f).readlines()
|
||||
lines = open(f,'r').readlines()
|
||||
d = []
|
||||
state_input_pattern = re.compile(r'(?P<key>[^\s]+)\s+(?P<value>.*)')
|
||||
while len(lines) > 0:
|
||||
|
||||
Reference in New Issue
Block a user