##// END OF EJS Templates
removed with notation. This is not supported by python 3.5
kd2718 -
Show More
@@ -218,8 +218,9 b' class OSMagics(Magics):'
218 218 os.chdir(pdir)
219 219 except OSError:
220 220 continue
221
222 # use with notation for python 3.6 onward
221 223 dirlist = os.scandir(path=pdir)
222 #with os.scandir(pdir) as dirlist:
223 224 for ff in dirlist:
224 225 if self.isexec(ff):
225 226 fname = ff.name
@@ -240,7 +241,9 b' class OSMagics(Magics):'
240 241 os.chdir(pdir)
241 242 except OSError:
242 243 continue
243 with os.scandir(pdir) as dirlist:
244
245 # use with notation for python 3.6 onward
246 dirlist = os.scandir(pdir)
244 247 for ff in dirlist:
245 248 fname = ff.name
246 249 base, ext = os.path.splitext(fname)
@@ -97,7 +97,9 b" ipython locate profile foo # print the path to the directory for profile 'foo'"
97 97 def list_profiles_in(path):
98 98 """list profiles in a given root directory"""
99 99 profiles = []
100 with os.scandir(path) as files:
100
101 # use with notation for python 3.6 onward
102 files = os.scandir(path)
101 103 for f in files:
102 104 if f.is_dir() and f.name.startswith('profile_'):
103 105 profiles.append(f.name.split('_', 1)[-1])
@@ -108,7 +110,9 b' def list_bundled_profiles():'
108 110 """list profiles that are bundled with IPython."""
109 111 path = os.path.join(get_ipython_package_dir(), u'core', u'profile')
110 112 profiles = []
111 with os.scandir(path) as files:
113
114 # use with notation for python 3.6 onward
115 files = os.scandir(path)
112 116 for profile in files:
113 117 if profile.is_dir() and profile.name != "__pycache__":
114 118 profiles.append(profile.name)
General Comments 0
You need to be logged in to leave comments. Login now