python-modernize -f libmodernize.fixes.fix_file

This commit is contained in:
Tomas Kopecek 2017-05-03 11:42:09 +02:00
parent 68bf19c739
commit a4a1536a03
13 changed files with 58 additions and 58 deletions

View file

@ -736,7 +736,7 @@ def read_policies(fn=None):
The expected format as follows
test [params] [&& test [params] ...] :: (keep|untag|skip)
"""
fo = file(fn, 'r')
fo = open(fn, 'r')
tests = koji.policy.findSimpleTests(globals())
ret = koji.policy.SimpleRuleSet(fo, tests)
fo.close()

View file

@ -452,7 +452,7 @@ class TrackedBuild(object):
fsrc = urllib2.urlopen(url)
fn = "%s/%s.src.rpm" % (options.workpath, self.nvr)
koji.ensuredir(os.path.dirname(fn))
fdst = file(fn, 'w')
fdst = open(fn, 'w')
shutil.copyfileobj(fsrc, fdst)
fsrc.close()
fdst.close()
@ -892,7 +892,7 @@ class BuildTracker(object):
os.chown(os.path.dirname(dst), 48, 48) #XXX - hack
log ("Downloading %s to %s" % (url, dst))
fsrc = urllib2.urlopen(url)
fdst = file(fn, 'w')
fdst = open(fn, 'w')
shutil.copyfileobj(fsrc, fdst)
fsrc.close()
fdst.close()
@ -905,7 +905,7 @@ class BuildTracker(object):
dst = "%s/%s" % (options.workpath, fn)
log ("Downloading %s to %s..." % (url, dst))
fsrc = urllib2.urlopen(url)
fdst = file(dst, 'w')
fdst = open(dst, 'w')
shutil.copyfileobj(fsrc, fdst)
fsrc.close()
fdst.close()