Skip to content

Commit

Permalink
Fix Python 2 -> 3 leftover.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Jan 14, 2025
1 parent be56ce1 commit f5a5ba1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/zope/password/tests/test_zpasswd.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ def setUp(self):

@contextlib.contextmanager
def patched_stdio(self, input_data=None):
io_type = io.StringIO if bytes is not str else io.BytesIO
self.stdout = io_type()
self.stderr = io_type()
self.stdout = io.StringIO()
self.stderr = io.StringIO()

self.old_stdout = sys.stdout
self.old_stderr = sys.stderr
Expand All @@ -61,7 +60,7 @@ def patched_stdio(self, input_data=None):
sys.stderr = self.stderr

if input_data is not None:
self.stdin = io_type(input_data)
self.stdin = io.StringIO(input_data)
sys.stdin = self.stdin

try:
Expand Down

0 comments on commit f5a5ba1

Please sign in to comment.