File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 4
4
"""
5
5
6
6
7
- import sys
8
7
import copy
9
8
import numpy
10
9
import pickle
11
10
12
11
from diffpy .srreal .structureconverters import convertObjCrystCrystal
13
12
from diffpy .srreal .tests import logger
14
13
15
- # Handle renamed diffpy.structure module by importing it to a common name .
16
- # TODO simplify when Python 2 support is dropped .
14
+ # Deprecated in 1.3 - import of old camel-case diffpy.Structure names .
15
+ # TODO drop this in version 1.4 .
17
16
18
- if sys . version_info [ 0 ] >= 3 :
17
+ try :
19
18
import diffpy .structure as mod_structure
20
19
from diffpy .structure .parsers import getParser
21
- else :
22
- import diffpy .Structure as mod_structure
23
- from diffpy .Structure .Parsers import getParser
20
+ except ImportError as e :
21
+ try :
22
+ import diffpy .Structure as mod_structure
23
+ from diffpy .Structure .Parsers import getParser
24
+ except ImportError :
25
+ raise e
26
+ del e
24
27
25
28
# Resolve availability of optional packages.
26
29
You can’t perform that action at this time.
0 commit comments