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 |
|
|
245 | 248 |
|
|
246 | 249 |
|
@@ -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 |
|
|
102 | 104 |
|
|
103 | 105 |
|
@@ -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 |
|
|
113 | 117 |
|
|
114 | 118 |
|
General Comments 0
You need to be logged in to leave comments.
Login now