|
3 | 3 | __docformat__ = "restructuredtext" |
4 | 4 |
|
5 | 5 | # 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 = [] |
8 | 8 |
|
9 | | -for dependency in hard_dependencies: |
| 9 | +for _dependency in _hard_dependencies: |
10 | 10 | 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}") |
14 | 14 |
|
15 | | -if missing_dependencies: |
| 15 | +if _missing_dependencies: |
16 | 16 | raise ImportError( |
17 | | - "Unable to import required dependencies:\n" + "\n".join(missing_dependencies) |
| 17 | + "Unable to import required dependencies:\n" + "\n".join(_missing_dependencies) |
18 | 18 | ) |
19 | | -del hard_dependencies, dependency, missing_dependencies |
| 19 | +del _hard_dependencies, _dependency, _missing_dependencies |
20 | 20 |
|
21 | 21 | # numpy compat |
22 | 22 | from pandas.compat import is_numpy_dev as _is_numpy_dev |
23 | 23 |
|
24 | 24 | try: |
25 | 25 | 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 |
28 | 28 | 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 " |
30 | 30 | "pandas from the source directory, you may need to run " |
31 | 31 | "'python setup.py build_ext --force' to build the C extensions first." |
32 | | - ) from err |
| 32 | + ) from _err |
33 | 33 | else: |
34 | 34 | del _tslib, _lib, _hashtable |
35 | 35 |
|
|
0 commit comments