Skip to content

Commit 516836d

Browse files
Apply suggestions from code review
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 155f045 commit 516836d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def getvalue(self):
285285
return result
286286

287287
def truncate(self, size=None):
288-
if size != None:
288+
if size is not None:
289289
self.seek(size)
290290
StringIO.truncate(self)
291291

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
A bug in :func:`doctest._SpoofOut.truncate` was causing None to be passed to :func:`StringIO.seek` when no size was given.
2-
A simple fix skips the seek call when no size is given so the buffer can be truncated from the current position.
1+
A bug in :func:`!doctest._SpoofOut.truncate` was causing None to be passed to :func:`!StringIO.seek` when no size was given.
2+
A simple fix skips the seek call when no size is given so the buffer can be truncated from the current position.

0 commit comments

Comments
 (0)