[python] Use pathlib.Path.iterdir
to count fragments
#3168
+5
−6
Merged