mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	Closes #1706: Added deprecation warning for Python 2
This commit is contained in:
		@@ -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'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user