Skip to content

Commit

Permalink
Fix import or URLError which has been removed in xmlschema (#524)
Browse files Browse the repository at this point in the history
As of `xmlschema==1.2.0` the `xmlschema.exceptions.URLError` exception
has been removed. This was just an alias for Python 2 and 3 compatibility
reasons, which now that Python 2 support is dropped can be removed.
Simply using `from urllib.error import URLError` addressed the problem.
  • Loading branch information
sphuber authored Jun 4, 2020
1 parent a835a6f commit 6dd89e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions aiida_quantumespresso/parsers/parse_xml/pw/parse.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
from distutils.version import StrictVersion
import numpy as np
from urllib.error import URLError

from xmlschema import XMLSchema
from xmlschema.etree import ElementTree
from xmlschema.exceptions import URLError
from qe_tools.constants import hartree_to_ev, bohr_to_ang, ry_to_ev

from aiida_quantumespresso.utils.mapping import get_logging_container
from qe_tools.constants import hartree_to_ev, bohr_to_ang, ry_to_ev

from .exceptions import XMLParseError
from .legacy import parse_pw_xml_pre_6_2
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"aiida_core[atomic_tools]~=1.2",
"packaging",
"qe-tools~=1.1",
"xmlschema~=1.0"
"xmlschema~=1.2"
],
"license": "MIT License",
"name": "aiida_quantumespresso",
Expand Down

0 comments on commit 6dd89e4

Please sign in to comment.