From 8a1db5ceeca260920f67b2c6b21c7c32d07e7a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Wed, 31 Jul 2024 13:31:47 +0300 Subject: [PATCH] Remove Django <1.10 compatability code --- djclick/adapter.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/djclick/adapter.py b/djclick/adapter.py index d8191d4..de2819a 100644 --- a/djclick/adapter.py +++ b/djclick/adapter.py @@ -4,17 +4,9 @@ import click -from django import get_version, VERSION as DJANGO_VERSION from django.core.management import CommandError -class OptionParseAdapter(object): - """Django pre-1.10-compatible adapter, deprecated""" - - def parse_args(self, args): - return (self, None) # NOCOV - - class ArgumentParserDefaults(object): def __init__(self, args): self._args = args @@ -80,10 +72,8 @@ def create_parser(self, progname, subcommand): """ Called when run through `call_command`. """ - if DJANGO_VERSION >= (1, 10): - return ArgumentParserAdapter() - else: # NOCOV - return OptionParseAdapter() + return ArgumentParserAdapter() + def print_help(self, prog_name, subcommand): prog_name = "{} {}".format(prog_name, subcommand)