MCPcopy Index your code
hub / github.com/python/cpython / fcompare

Function fcompare

Doc/includes/ndiff.py:55–66  ·  view source on GitHub ↗
(f1name, f2name)

Source from the content-addressed store, hash-verified

53
54# open two files & spray the diff to stdout; return false iff a problem
55def fcompare(f1name, f2name):
56 f1 = fopen(f1name)
57 f2 = fopen(f2name)
58 if not f1 or not f2:
59 return 0
60
61 a = f1.readlines(); f1.close()
62 b = f2.readlines(); f2.close()
63 for line in difflib.ndiff(a, b):
64 print(line, end=' ')
65
66 return 1
67
68# crack args (sys.argv[1:] is normal) & compare;
69# return false iff a problem

Callers 1

mainFunction · 0.85

Calls 3

fopenFunction · 0.85
readlinesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…