##// END OF EJS Templates
Enforce some more types since we are Py3only
Matthias Bussonnier -
Show More
@@ -12,7 +12,7 b' from IPython.utils.path import ('
12 12 ensure_dir_exists, fs_encoding)
13 13 from IPython.utils import py3compat
14 14
15 def get_ipython_dir():
15 def get_ipython_dir() -> str:
16 16 """Get the IPython directory for this platform and user.
17 17
18 18 This uses the logic in `get_home_dir` to find the home directory
@@ -28,10 +28,9 b' def get_ipython_dir():'
28 28 home_dir = get_home_dir()
29 29 xdg_dir = get_xdg_dir()
30 30
31 # import pdb; pdb.set_trace() # dbg
32 31 if 'IPYTHON_DIR' in env:
33 warn('The environment variable IPYTHON_DIR is deprecated. '
34 'Please use IPYTHONDIR instead.')
32 warn('The environment variable IPYTHON_DIR is deprecated since IPython 3.0. '
33 'Please use IPYTHONDIR instead.', DeprecationWarning)
35 34 ipdir = env.get('IPYTHONDIR', env.get('IPYTHON_DIR', None))
36 35 if ipdir is None:
37 36 # not set explicitly, use ~/.ipython
@@ -67,8 +66,8 b' def get_ipython_dir():'
67 66 warn("IPython parent '{0}' is not a writable location,"
68 67 " using a temp directory.".format(parent))
69 68 ipdir = tempfile.mkdtemp()
70
71 return py3compat.cast_unicode(ipdir, fs_encoding)
69 assert isinstance(ipdir, str), "all path manipulation should be str(unicode), but are not."
70 return ipdir
72 71
73 72
74 73 def get_ipython_cache_dir():
General Comments 0
You need to be logged in to leave comments. Login now