File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,26 @@ def __is_spyder():
77
88
99def _spyder_run_setting_is_correct ():
10- from spyder .config .main import CONF
10+ try :
11+ # This is the spyder 3 location
12+ from spyder .config .main import CONF
13+ except ImportError :
14+ # CONF moved in spyder 4
15+ from spyder .config .manager import CONF
16+
1117 # Use this instead of accessing like a dictionary so that a
1218 # default value can be supplied if the setting is missing.
1319 return CONF .get ('run' , 'default/interpreter/dedicated' , False )
1420
1521
1622def _warn_if_spyder_settings_wrong ():
17- if not _spyder_run_setting_is_correct ():
23+ from spyder import __version__
24+ from packaging import version
25+ pre_4 = version .parse (__version__ ) < version .parse ('4.0.0' )
26+ # It looks like spyder 4 works fine without this setting, perhaps
27+ # related to the change that they run files in an empty namespace
28+ # instead of the namespace of the current console.
29+ if not _spyder_run_setting_is_correct () and pre_4 :
1830 print ('\x1b [1;31m**** Please set spyder preference Run to '
1931 '"Execute in a dedicated console" for the best '
2032 'vpython experience. ****\x1b [0m' )
You can’t perform that action at this time.
0 commit comments