-
Notifications
You must be signed in to change notification settings - Fork 302
Expand file tree
/
Copy pathping_py_changes.txt
More file actions
35 lines (20 loc) · 1.03 KB
/
ping_py_changes.txt
File metadata and controls
35 lines (20 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Added the following changes:
changed if sys.platform() to sys.platform.startswith() at lines 3, 6, and 9
Added two extra if statements line 6, and 9 for detecting linux and mac
removed () from default_timer at lines 46, 48, 52 and 82
Changes time.clock() which is depreciated to time.perf_counter() as lines 3 , 6
9, and 14
Changed count_to = (len(source_string) / 2) * 2 to
count_to = (len(source_string) // 2) * 2 at line 20
Changed ord(ord(source_string[count + 1]) * 256 + ord(source_string[count])) to
(source_string[count + 1]) * 256 + source_string[count] at line 23
Renamed variables into more readable format.
Changed except socket.error, (errno, msg): to except socket.error (errno, msg)
at line 104
Changed except socket.gaierror, e: to except socket.gaierror as e: at line 130
Changed xrange() to range at line 125 because xrange was changed to range in
python 3+
Changed print("ping %s..." % dest_addr,) to print("ping %s..." % dest_addr)
at line 126
added padding function
added encoding at line 83 and decoding at line 90