Skip to content

Commit

Permalink
Remove remnants of Python 2 support code.
Browse files Browse the repository at this point in the history
  • Loading branch information
charettes committed Jun 5, 2020
1 parent 337470f commit ceee08c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
2 changes: 0 additions & 2 deletions picklefield/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from __future__ import unicode_literals

DEFAULT_PROTOCOL = 3
8 changes: 1 addition & 7 deletions picklefield/fields.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import unicode_literals

from base64 import b64decode, b64encode
from copy import deepcopy
from pickle import dumps, loads
from zlib import compress, decompress

from django import VERSION as DJANGO_VERSION
Expand All @@ -11,11 +10,6 @@

from .constants import DEFAULT_PROTOCOL

try:
from cPickle import loads, dumps # pragma: no cover
except ImportError:
from pickle import loads, dumps # pragma: no cover


class PickledObject(str):
"""
Expand Down
2 changes: 0 additions & 2 deletions tests/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from datetime import date

from django.db import models
Expand Down
2 changes: 0 additions & 2 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

SECRET_KEY = 'not-anymore'

DATABASES = {
Expand Down
8 changes: 2 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from datetime import date
from unittest.mock import patch

from django.core import checks, serializers
from django.db import IntegrityError, models
Expand All @@ -14,18 +15,13 @@
TestCustomDataType, TestingModel,
)

try:
from unittest.mock import patch # pragma: no cover
except ImportError:
from mock import patch # pragma: no cover


class PickledObjectFieldTests(TestCase):
def setUp(self):
self.testing_data = (D2, S1, T1, L1,
TestCustomDataType(S1),
MinimalTestingModel)
return super(PickledObjectFieldTests, self).setUp()
return super().setUp()

def test_data_integrity(self):
"""
Expand Down

0 comments on commit ceee08c

Please sign in to comment.