Skip to content

Commit e7d8ade

Browse files
authored
Merge pull request #1 from NeuralFlux/NeuralFlux-patch-1
Added explicit exceptions to '_print_versions.py'
2 parents 9809410 + 9042d42 commit e7d8ade

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/util/_print_versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_sys_info():
2121
stdout=subprocess.PIPE,
2222
stderr=subprocess.PIPE)
2323
so, serr = pipe.communicate()
24-
except:
24+
except (OSError, ValueError):
2525
pass
2626
else:
2727
if pipe.returncode == 0:
@@ -50,7 +50,7 @@ def get_sys_info():
5050
("LANG", "{lang}".format(lang=os.environ.get('LANG', "None"))),
5151
("LOCALE", '.'.join(map(str, locale.getlocale()))),
5252
])
53-
except:
53+
except (KeyError, ValueError):
5454
pass
5555

5656
return blob
@@ -108,7 +108,7 @@ def show_versions(as_json=False):
108108
mod = importlib.import_module(modname)
109109
ver = ver_f(mod)
110110
deps_blob.append((modname, ver))
111-
except:
111+
except ModuleNotFoundError:
112112
deps_blob.append((modname, None))
113113

114114
if (as_json):

0 commit comments

Comments
 (0)