diff options
-rw-r--r-- | gbp/config.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gbp/config.py b/gbp/config.py index 0f0bdc6f..8b659240 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -371,15 +371,15 @@ class GbpOptionParser(OptionParser): # Read per-tree config file if repo and git_treeish and filename.startswith('%(top_dir)s/'): - with tempfile.TemporaryFile() as tmp: + with tempfile.NamedTemporaryFile() as tmp: relpath = filename.replace('%(top_dir)s/', '') try: config = repo.show('%s:%s' % (git_treeish, relpath)) - tmp.writelines(config) + tmp.write(config) except GitRepositoryError: pass tmp.seek(0) - parser.readfp(tmp) + parser.read(tmp.name) return try: filename = filename % str_fields |