Skip to content

Commit 87a9dad

Browse files
committed
Add error for scriptable CIF import w/o PyCifRW, as per #165
1 parent ac8e805 commit 87a9dad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

GSASII/imports/G2phase_CIF.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def ContentsValidator(self, filename):
4747
return ok
4848

4949
def Reader(self,filename, ParentFrame=None, usedRanIdList=[], **unused):
50+
if cif is None: # can happen in scripting
51+
print('Attempting to read a CIF without PyCifRW installed')
52+
raise Exception('Attempting to read a CIF without PyCifRW installed')
5053
isodistort_warnings = '' # errors that would prevent an isodistort analysis
5154
self.Phase = G2obj.SetNewPhase(Name='new phase') # create a new empty phase dict
5255
# make sure the ranId is really unique!

0 commit comments

Comments
 (0)