File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 1717
1818python_version = sys .version_info [:2 ]
1919
20- assert python_version >= (3 , 7 ), "The New Relic Python agent only supports Python 3.7+."
20+ if python_version >= (3 , 7 ):
21+ pass
22+ else :
23+ error_msg = "The New Relic Python agent only supports Python 3.7+. We recommend upgrading to a newer version of Python."
24+
25+ try :
26+ # Lookup table for the last agent versions to support each Python version.
27+ last_supported_version_lookup = {
28+ (2 , 6 ): "3.4.0.95" ,
29+ (2 , 7 ): "9.13.0" ,
30+ (3 , 3 ): "3.4.0.95" ,
31+ (3 , 4 ): "4.20.0.120" ,
32+ (3 , 5 ): "5.24.0.153" ,
33+ (3 , 6 ): "7.16.0.178" ,
34+ }
35+ last_supported_version = last_supported_version_lookup .get (python_version , None )
36+
37+ if last_supported_version :
38+ python_version_str = "%s.%s" % (python_version [0 ], python_version [1 ])
39+ error_msg += " The last agent version to support Python %s was v%s." % (python_version_str , last_supported_version )
40+ except Exception :
41+ pass
42+
43+ raise RuntimeError (error_msg )
2144
2245with_setuptools = False
2346
You can’t perform that action at this time.
0 commit comments