mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Closes #1706: Added deprecation warning for Python 2
This commit is contained in:
parent
3df8c63d5c
commit
5c13382071
@ -1,6 +1,8 @@
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
from django.contrib.messages import constants as messages
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
@ -12,6 +14,13 @@ except ImportError:
|
||||
"Configuration file is not present. Please define netbox/netbox/configuration.py per the documentation."
|
||||
)
|
||||
|
||||
# Raise a deprecation warning for Python 2.x
|
||||
if sys.version_info[0] < 3:
|
||||
warnings.warn(
|
||||
"Support for Python 2 will be removed in NetBox v2.5. Please consider migration to Python 3 at your earliest "
|
||||
"opportunity. Guidance is available in the documentation at http://netbox.readthedocs.io/.",
|
||||
DeprecationWarning
|
||||
)
|
||||
|
||||
VERSION = '2.2.6-dev'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user