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

Function _test

Lib/fileinput.py:426–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

424
425
426def _test():
427 import getopt
428 inplace = False
429 backup = False
430 opts, args = getopt.getopt(sys.argv[1:], "ib:")
431 for o, a in opts:
432 if o == '-i': inplace = True
433 if o == '-b': backup = a
434 for line in input(args, inplace=inplace, backup=backup):
435 if line[-1:] == '\n': line = line[:-1]
436 if line[-1:] == '\r': line = line[:-1]
437 print("%d: %s[%d]%s %s" % (lineno(), filename(), filelineno(),
438 isfirstline() and "*" or "", line))
439 print("%d: %s[%d]" % (lineno(), filename(), filelineno()))
440
441if __name__ == '__main__':
442 _test()

Callers 1

fileinput.pyFile · 0.70

Calls 5

inputFunction · 0.85
linenoFunction · 0.85
filenameFunction · 0.85
filelinenoFunction · 0.85
isfirstlineFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…