Update ping.py

applied a minor code fix