Changeset 3458


Ignore:
Timestamp:
Jun 28, 2018 4:50:46 PM (3 years ago)
Author:
toby
Message:

Complete basestring fix

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3452 r3458  
    33893389        # make lists of variables of different types along with lists of parameter names, histogram #s, phase #s,...
    33903390        self.parmNames = sorted(list(parmDict.keys()))
    3391         basestr = basestring
     3391        if '2' in platform.python_version_tuple()[0]:
     3392            basestr = basestring
     3393        else:
     3394            basestr = str
    33923395        splitNames = [item.split(':') for item in self.parmNames if len(item) > 3 and not isinstance(self.parmDict[item],basestr)]
    33933396        globNames = [':'.join(item) for item in splitNames if not item[0] and not item[1]]
     
    34283431        count = 0
    34293432        for name in self.choiceDict[self.parmChoice]:
    3430             basestr = basestring
     3433            if '2' in platform.python_version_tuple()[0]:
     3434                basestr = basestring
     3435            else:
     3436                basestr = str
    34313437            if isinstance(self.parmDict[name],basestr): continue
    34323438            if 'Refined' in self.listSel and (name not in self.fullVaryList
  • trunk/GSASIIexprGUI.py

    r3457 r3458  
    185185                val = parmDict[key]
    186186            if '2' in platform.python_version_tuple()[0]:
    187                 string = basestring
     187                basestr = basestring
    188188            else:
    189                 string = str
    190             if isinstance(val, string): continue
     189                basestr = str
     190            if isinstance(val, basestr): continue
    191191            try:
    192192                self.parmDict[key] = float(val)
  • trunk/GSASIIobj.py

    r3447 r3458  
    25622562        '''
    25632563        # Patch: for old-style expressions with a (now removed step size)
    2564         if '2' not in platform.python_version_tuple()[0]: basestring = str
     2564        if '2' in platform.python_version_tuple()[0]:
     2565            basestr = basestring
     2566        else:
     2567            basestr = str
    25652568        for v in self.eObj.assgnVars:
    2566             if not isinstance(self.eObj.assgnVars[v], basestring):
     2569            if not isinstance(self.eObj.assgnVars[v], basestr):
    25672570                self.eObj.assgnVars[v] = self.eObj.assgnVars[v][0]
    25682571        self.parmDict = {}
     
    25822585        # look at first value in parmDict to determine its type
    25832586        parmsInList = True
    2584         if '2' not in platform.python_version_tuple()[0]: basestring = str
     2587        if '2' in platform.python_version_tuple()[0]:
     2588            basestr = basestring
     2589        else:
     2590            basestr = str
    25852591        for key in parmDict:
    25862592            val = parmDict[key]
    2587             if isinstance(val, basestring):
     2593            if isinstance(val, basestr):
    25882594                parmsInList = False
    25892595                break
Note: See TracChangeset for help on using the changeset viewer.