diff --git a/pyscf/pbc/symm/pyscf_spglib.py b/pyscf/pbc/symm/pyscf_spglib.py index 2bdeff2b64..3a0d1442cb 100644 --- a/pyscf/pbc/symm/pyscf_spglib.py +++ b/pyscf/pbc/symm/pyscf_spglib.py @@ -38,8 +38,7 @@ def cell_to_spgcell(cell): atm_num.append(elements.NUC[symbol]) for iatm in range(cell.natm): symb = cell.atom_symbol(iatm) - idx = ''.join([i for i in symb if unicode(i).isnumeric()]) - idx = unicode(idx) + idx = ''.join([i for i in symb if i.isnumeric()]) if idx.isnumeric(): atm_num[iatm] += int(idx) * 1000 spg_cell = (a, atm_pos, atm_num, cell.magmom) diff --git a/pyscf/solvent/pol_embed.py b/pyscf/solvent/pol_embed.py index 6a8b66c9d1..5778b33dec 100644 --- a/pyscf/solvent/pol_embed.py +++ b/pyscf/solvent/pol_embed.py @@ -47,7 +47,8 @@ import cppe from packaging.version import parse as _parse_version -if _parse_version(cppe.__version__) < _parse_version('0.3.1'): +min_version = '0.3.1' +if _parse_version(cppe.__version__) < _parse_version(min_version): raise ModuleNotFoundError("cppe version {} is required at least. " "Version {} was found.".format(min_version, cppe.__version__))