python-modernize -f libmodernize.fixes.fix_file

This commit is contained in:
Tomas Kopecek 2018-06-28 16:56:07 +02:00 committed by Mike McLean
parent 5ad9027320
commit d92fa1fa9c
5 changed files with 15 additions and 15 deletions

View file

@ -737,7 +737,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

@ -451,7 +451,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()
@ -889,7 +889,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()
@ -902,7 +902,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()