```py
while '//' in p:
    p.replace('//', '/')
```

(or just use re.replaceall or whatever it's called)