From 8831fe9c646ff76e2e3efc7a3a3a240036e17eb5 Mon Sep 17 00:00:00 2001 From: David Krauth Date: Tue, 2 Aug 2022 14:55:16 +0900 Subject: [PATCH] Django 1.5 compatibility --- setup.cfg | 3 +++ setup.py | 2 +- src/reversion/admin.py | 2 +- src/reversion/revisions.py | 8 +------- src/reversion/tests.py | 2 +- src/reversion/version.py | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..01336929 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[egg_info] +tag_build = +ge.1.0 +tag_date = false diff --git a/setup.py b/setup.py index 6258be96..dd8d08e3 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import sys sys.path.insert(0, 'src/reversion') -from distutils.core import setup +from setuptools import setup from version import __version__ diff --git a/src/reversion/admin.py b/src/reversion/admin.py index 3d58aaf0..91188311 100644 --- a/src/reversion/admin.py +++ b/src/reversion/admin.py @@ -3,7 +3,7 @@ from django import template from django.db import models, transaction, connection -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url from django.contrib import admin from django.contrib.admin import helpers, options from django.contrib.admin.util import unquote, quote diff --git a/src/reversion/revisions.py b/src/reversion/revisions.py index 9f4f79cd..cdf82a98 100644 --- a/src/reversion/revisions.py +++ b/src/reversion/revisions.py @@ -1,11 +1,5 @@ """Revision management for django-reversion.""" - - -try: - from functools import wraps -except ImportError: - from django.utils.functional import wraps # Python 2.4 fallback. - +from functools import wraps import operator, sys from threading import local from weakref import WeakValueDictionary diff --git a/src/reversion/tests.py b/src/reversion/tests.py index 5f82fc4a..224c4b3a 100644 --- a/src/reversion/tests.py +++ b/src/reversion/tests.py @@ -12,7 +12,7 @@ from django.test import TestCase from django.core.management import call_command from django.conf import settings -from django.conf.urls.defaults import * +from django.conf.urls import * from django.contrib import admin from django.contrib.auth.models import User from django.utils.decorators import decorator_from_middleware diff --git a/src/reversion/version.py b/src/reversion/version.py index 10ef6561..69b065dc 100644 --- a/src/reversion/version.py +++ b/src/reversion/version.py @@ -1 +1 @@ -__version__ = (1, 6, 6) +__version__ = (1, 6, 7)