diff --git a/slacker/__init__.py b/slacker/__init__.py
index <HASH>..<HASH> 100644
--- a/slacker/__init__.py
+++ b/slacker/__init__.py
@@ -600,7 +600,7 @@ class Files(BaseAPI):
         }
 
         if file_:
-            if type(file_) in types.StringTypes:
+            if isinstance(file_, str):
                 file_ = open(file_, 'rb')
             return self.post('files.upload', data=data, files={'file': file_})
         else:
Replace `types.StringTypes` with `isinstance`

As `types.StringTypes` is not available in Python 3+