We need Py3 compat for the future. Could you please adapt to something like:

```python
from salt._compat import string_types

(.....)
if isinstance(timeout, string_types):
    try:

(.....)
```