File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -204,15 +204,16 @@ def on_config(self, config):
204
204
# Guess other Virtual Environment paths in case we forget to activate
205
205
# them or in case we have multiple. Making sure which venv is activated
206
206
# is not necessary, as it is an optional step in the guidelines.
207
- for path in glob .iglob (
208
- pathname = "**/pyvenv.cfg" ,
209
- root_dir = os .getcwd (),
210
- recursive = True
211
- ):
212
- path = os .path .join (os .getcwd (), os .path .dirname (path ))
213
- if path not in site .PREFIXES :
214
- print (f"Possible inactive venv: { path } " )
215
- self .exclusion_patterns .append (_resolve_pattern (path ))
207
+ for abs_root , dirnames , filenames in os .walk (os .getcwd ()):
208
+ for filename in filenames :
209
+ if filename .lower () != "pyvenv.cfg" :
210
+ continue
211
+
212
+ path = abs_root [0 ].upper () + abs_root [1 :]
213
+
214
+ if path not in site .PREFIXES :
215
+ print (f"Possible inactive venv: { path } " )
216
+ self .exclusion_patterns .append (_resolve_pattern (path ))
216
217
217
218
# Exclude site_dir for projects
218
219
if projects_plugin :
Original file line number Diff line number Diff line change @@ -204,15 +204,16 @@ def on_config(self, config):
204
204
# Guess other Virtual Environment paths in case we forget to activate
205
205
# them or in case we have multiple. Making sure which venv is activated
206
206
# is not necessary, as it is an optional step in the guidelines.
207
- for path in glob .iglob (
208
- pathname = "**/pyvenv.cfg" ,
209
- root_dir = os .getcwd (),
210
- recursive = True
211
- ):
212
- path = os .path .join (os .getcwd (), os .path .dirname (path ))
213
- if path not in site .PREFIXES :
214
- print (f"Possible inactive venv: { path } " )
215
- self .exclusion_patterns .append (_resolve_pattern (path ))
207
+ for abs_root , dirnames , filenames in os .walk (os .getcwd ()):
208
+ for filename in filenames :
209
+ if filename .lower () != "pyvenv.cfg" :
210
+ continue
211
+
212
+ path = abs_root [0 ].upper () + abs_root [1 :]
213
+
214
+ if path not in site .PREFIXES :
215
+ print (f"Possible inactive venv: { path } " )
216
+ self .exclusion_patterns .append (_resolve_pattern (path ))
216
217
217
218
# Exclude site_dir for projects
218
219
if projects_plugin :
You can’t perform that action at this time.
0 commit comments