Fix typo preventing the security confirmation prompt from working

Closes #303
This commit is contained in:
Jonas Borgström 2015-05-08 17:41:50 +02:00
parent c79b5357f8
commit a24d0f4cba
3 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,7 @@ Version 0.16
------------
(bugfix release, released on X)
- Fix typo preventing the security confirmation prompt from working (#303)
- Improve handling of systems with improperly configured file system encoding (#289)
- Fix "All archives" output for attic info. (#183)
- More user friendly error message when repository key file is not found (#236)

View File

@ -68,7 +68,7 @@ class Cache(object):
if env_var_override and os.environ.get(env_var_override):
print("Yes (From {})".format(env_var_override))
return True
if sys.stdin.isatty():
if not sys.stdin.isatty():
return False
try:
answer = input('Do you want to continue? [yN] ')

View File

@ -106,18 +106,19 @@ class ArchiverTestCaseBase(AtticTestCase):
self.assert_equal(exit_code, ret)
return output
args = list(args)
stdout, stderr = sys.stdout, sys.stderr
stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr
try:
sys.stdin = StringIO()
output = StringIO()
sys.stdout = sys.stderr = output
ret = self.archiver.run(args)
sys.stdout, sys.stderr = stdout, stderr
sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr
if ret != exit_code:
print(output.getvalue())
self.assert_equal(exit_code, ret)
return output.getvalue()
finally:
sys.stdout, sys.stderr = stdout, stderr
sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr
def create_src_archive(self, name):
self.attic('create', self.repository_location + '::' + name, src_dir)