Skip to content

Commit

Permalink
fix for python2
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ses committed Jul 20, 2023
1 parent 2e20b29 commit e7c0883
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 11 additions & 3 deletions TarSCM/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,17 @@ def _init_config(self, fname):

if self.fakeheader:
logging.debug("Using fakeheader for file '%s'", fname)
fake_header = '[' + self.default_section + ']\n'
config.read_string(fake_header + open(fname, 'r').read(),
source=fname)
try:
fake_header = '[' + self.default_section + ']\n'
config.read_string(fake_header + open(fname, 'r').read(),
source=fname)
except AttributeError:
tmp_fp = StringIO()
tmp_fp.write('[' + self.default_section + ']\n')
tmp_fp.write(open(fname, 'r').read())
tmp_fp.seek(0, os.SEEK_SET)
config.readfp(tmp_fp)

else:
config.read(fname)

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
obs-service-tar-scm (0.10.41) unstable; urgency=medium

* update to upstream version 0.10.41

-- Frank Schreiner <[email protected]> Thu, 20 Jul 2023 15:55:12 +0200

obs-service-tar-scm (0.10.40) unstable; urgency=medium

* update to upstream version 0.10.40
Expand Down

0 comments on commit e7c0883

Please sign in to comment.