Skip to content

Commit e1c9479

Browse files
twoertweinyehoshuadimarsky
authored andcommitted
TYP: Make temporary variables in pandas/__init__.py private (pandas-dev#46698)
1 parent aa3e593 commit e1c9479

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pandas/__init__.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
__docformat__ = "restructuredtext"
44

55
# Let users know if they're missing any of our hard dependencies
6-
hard_dependencies = ("numpy", "pytz", "dateutil")
7-
missing_dependencies = []
6+
_hard_dependencies = ("numpy", "pytz", "dateutil")
7+
_missing_dependencies = []
88

9-
for dependency in hard_dependencies:
9+
for _dependency in _hard_dependencies:
1010
try:
11-
__import__(dependency)
12-
except ImportError as e:
13-
missing_dependencies.append(f"{dependency}: {e}")
11+
__import__(_dependency)
12+
except ImportError as _e:
13+
_missing_dependencies.append(f"{_dependency}: {_e}")
1414

15-
if missing_dependencies:
15+
if _missing_dependencies:
1616
raise ImportError(
17-
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
17+
"Unable to import required dependencies:\n" + "\n".join(_missing_dependencies)
1818
)
19-
del hard_dependencies, dependency, missing_dependencies
19+
del _hard_dependencies, _dependency, _missing_dependencies
2020

2121
# numpy compat
2222
from pandas.compat import is_numpy_dev as _is_numpy_dev
2323

2424
try:
2525
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
26-
except ImportError as err: # pragma: no cover
27-
module = err.name
26+
except ImportError as _err: # pragma: no cover
27+
_module = _err.name
2828
raise ImportError(
29-
f"C extension: {module} not built. If you want to import "
29+
f"C extension: {_module} not built. If you want to import "
3030
"pandas from the source directory, you may need to run "
3131
"'python setup.py build_ext --force' to build the C extensions first."
32-
) from err
32+
) from _err
3333
else:
3434
del _tslib, _lib, _hashtable
3535

0 commit comments

Comments
 (0)