Skip to content

Commit

Permalink
Python 3.x compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeman committed Mar 11, 2015
1 parent 1b338a4 commit af17325
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/test_summary.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.helpers import read
from tests.core.helpers import read

from trakt import Trakt
import responses
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sync_movies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime
from core.helpers import read
from tests.core.helpers import read

from datetime import datetime
from trakt import Trakt
import responses

Expand Down
4 changes: 2 additions & 2 deletions tests/test_sync_shows.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime
from core.helpers import read
from tests.core.helpers import read

from datetime import datetime
from trakt import Trakt
import responses

Expand Down
5 changes: 3 additions & 2 deletions trakt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from trakt.client import TraktClient, __version__
from trakt.helpers import has_attribute

from six import add_metaclass


__all__ = [
'Trakt',
Expand Down Expand Up @@ -39,9 +41,8 @@ def __getitem__(self, key):
return self.client[key]


@add_metaclass(TraktMeta)
class Trakt(object):
__metaclass__ = TraktMeta

client = None

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion trakt/core/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from requests import Request
import json
import six


class TraktRequest(object):
Expand Down Expand Up @@ -46,7 +47,7 @@ def transform_parameters(self):
# Transform `params` into list
self.params = self.kwargs.get('params') or []

if isinstance(self.params, basestring):
if isinstance(self.params, six.string_types):
self.params = [self.params]

def transform_method(self):
Expand Down

0 comments on commit af17325

Please sign in to comment.