Skip to content

Commit a058e00

Browse files
committed
chore: filecmp add unittest
1 parent d4e5802 commit a058e00

File tree

2 files changed

+81
-350
lines changed

2 files changed

+81
-350
lines changed

Lib/filecmp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,12 @@ def _filter(flist, skip):
304304

305305
# Demonstration and testing.
306306
#
307-
def demo():
307+
def demo(args=None):
308308
import sys
309309
import getopt
310-
options, args = getopt.getopt(sys.argv[1:], 'r')
310+
311+
args = sys.argv[1:] if args is None else args
312+
options, args = getopt.getopt(args, 'r')
311313
if len(args) != 2:
312314
raise getopt.GetoptError('need exactly two args', None)
313315
dd = dircmp(args[0], args[1])

0 commit comments

Comments
 (0)