Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Use os.path.join to join multiple element in one single path
Browse files Browse the repository at this point in the history
  • Loading branch information
pypingou committed Feb 26, 2014
1 parent ef32e0c commit 9afe50f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions summershum/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def download_lookaside(message, lookaside_url, tmpdir):
}
)

local_filename = "/".join([tmpdir, message['filename']])
local_filename = os.path.join(tmpdir, message['filename'])

req = requests.get(url, stream=True)
with open(local_filename, 'wb') as stream:
Expand All @@ -39,7 +39,7 @@ def calculate_sums(session, message, tmpdir):
files in the sources get their sha256sum, sha1sum, and md5sum.
"""

local_filename = "/".join([tmpdir, message['filename']])
local_filename = os.path.join(tmpdir, message['filename'])

if not os.path.exists(local_filename):
raise IOError('File %s not found' % local_filename)
Expand Down Expand Up @@ -71,7 +71,7 @@ def calculate_sums(session, message, tmpdir):
filename = proc.communicate()[0].split('\n')[0].split('/')[0]

if filename:
filename = "/".join([tmpdir, filename])
filename = os.path.join(tmpdir, filename)
else:
log.warning("No files extracted from %r" % local_filename)
filename = tmpdir
Expand Down

0 comments on commit 9afe50f

Please sign in to comment.