| fromdistutils.versionimportLooseVersion |
| importIPython |
| ipython_version=LooseVersion(IPython.__version__) |
| ifipython_version<'0.11': |
| fromIPython.genutilsimportpage |
| fromIPython.ipstructimportStruct |
| fromIPython.ipapiimportUsageError |
| else: |
| fromIPython.core.pageimportpage |
| fromIPython.utils.ipstructimportStruct |
| fromIPython.core.errorimportUsageError |
In Python 3.12 distutils has been removed from the standard library.
We could
- add
setuptools to the dependencies (having it required for the build-system doesn't make it required for the built package). - write it like
try: fromIPython.core.pageimportpagefromIPython.utils.ipstructimportStructfromIPython.core.errorimportUsageErrorexceptImportError:
# probably IPython < 0.11fromIPython.genutilsimportpagefromIPython.ipstructimportStructfromIPython.ipapiimportUsageError
- drop support of IPython 0.11 from 2011 and just do
fromIPython.core.pageimportpagefromIPython.utils.ipstructimportStructfromIPython.core.errorimportUsageError
memory_profiler/memory_profiler.py
Lines 941 to 951 in 025929f
In Python 3.12
distutilshas been removed from the standard library.We could
setuptoolsto the dependencies (having it required for the build-system doesn't make it required for the built package).