Skip to content

Commit c8a46b0

Browse files
committed
move package test to after packages are imported
1 parent db4af55 commit c8a46b0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

GSASII/GSASIIdataGUI.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ def ShowVersions():
480480
print('Warning: Python requests package not installed (required for\n'+
481481
' GSAS-II to access web pages or self-install binary modules)')
482482
G2fil.NeededPackage({'Accessing web resources':['requests']})
483+
try:
484+
import pybaselines.whittaker
485+
except:
486+
G2fil.NeededPackage({'Auto background capability':['pybaselines']})
483487

484488
if not GSASIIpath.TestSPG():
485489
path2repo = os.path.dirname(GSASIIpath.path2GSAS2)

GSASII/GSASIIpwd.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from . import GSASIIspc as G2spc
3333
from . import GSASIIElem as G2elem
3434
from . import GSASIImath as G2mth
35+
from . import GSASIIfiles as G2fil
3536
try:
3637
if GSASIIpath.binaryPath:
3738
import pypowder as pyd
@@ -46,13 +47,6 @@
4647
from . import pydiffax as pyx
4748
except ImportError:
4849
print ('pydiffax is not available for this platform')
49-
from . import GSASIIfiles as G2fil
50-
try:
51-
import pybaselines.whittaker
52-
except:
53-
G2fil.NeededPackage({'Auto background capability':['pybaselines']})
54-
55-
5650

5751
# trig functions in degrees
5852
tand = lambda x: math.tan(x*math.pi/180.)

0 commit comments

Comments
 (0)