Ignore:
Timestamp:
Apr 20, 2017 6:29:34 AM (8 years ago)
Author:
andyfaff
Children:
0cc77d8
Parents:
b636dfc5
git-author:
Andrew Nelson <andyfaff@…> (04/20/17 06:25:57)
git-committer:
Andrew Nelson <andyfaff@…> (04/20/17 06:29:34)
Message:

MAINT: use raise Exception() not raise Exception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/ascii_reader.py

    r235f514 rb9d74f3  
    6464                    input_f = open(path,'rb') 
    6565                except: 
    66                     raise  RuntimeError, "ascii_reader: cannot open %s" % path 
     66                    raise  RuntimeError("ascii_reader: cannot open %s" % path) 
    6767                buff = input_f.read() 
    6868                lines = buff.splitlines() 
     
    173173                if not is_data: 
    174174                    msg = "ascii_reader: x has no data" 
    175                     raise RuntimeError, msg 
     175                    raise RuntimeError(msg) 
    176176                # Sanity check 
    177177                if has_error_dy == True and not len(ty) == len(tdy): 
    178178                    msg = "ascii_reader: y and dy have different length" 
    179                     raise RuntimeError, msg 
     179                    raise RuntimeError(msg) 
    180180                if has_error_dx == True and not len(tx) == len(tdx): 
    181181                    msg = "ascii_reader: y and dy have different length" 
    182                     raise RuntimeError, msg 
     182                    raise RuntimeError(msg) 
    183183                # If the data length is zero, consider this as 
    184184                # though we were not able to read the file. 
    185185                if len(tx) == 0: 
    186                     raise RuntimeError, "ascii_reader: could not load file" 
     186                    raise RuntimeError("ascii_reader: could not load file") 
    187187 
    188188                #Let's re-order the data to make cal. 
     
    222222                output.meta_data['loader'] = self.type_name 
    223223                if len(output.x) < 1: 
    224                     raise RuntimeError, "%s is empty" % path 
     224                    raise RuntimeError("%s is empty" % path) 
    225225                return output 
    226226 
    227227        else: 
    228             raise RuntimeError, "%s is not a file" % path 
     228            raise RuntimeError("%s is not a file" % path) 
    229229        return None 
    230230 
Note: See TracChangeset for help on using the changeset viewer.