Changeset 47be5a1 in sasview for src/sas/_config.py


Ignore:
Timestamp:
Nov 2, 2018 1:04:28 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249
Children:
93b34cc
Parents:
d742b56
Message:

redo handling of cust config failures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/_config.py

    rb963b20 r47be5a1  
    9494            logger.error("Could not copy default custom config.") 
    9595 
     96    custom_config = load_custom_config(path) 
     97 
    9698    #Adding SAS_OPENCL if it doesn't exist in the config file 
    9799    # - to support backcompability 
    98     if not "SAS_OPENCL" in open(path).read(): 
     100    if not hasattr(custom_config, "SAS_OPENCL"): 
     101        custom_config.SAS_OPENCL = None 
    99102        try: 
    100103            open(config_file, "a+").write("SAS_OPENCL = \"None\"\n") 
     
    102105            logger.error("Could not update custom config with SAS_OPENCL.") 
    103106 
    104     custom_config = load_custom_config(path) 
    105107    return custom_config 
    106  
    107108 
    108109def load_custom_config(path): 
Note: See TracChangeset for help on using the changeset viewer.