import gzip   #pragma: no cover
import bz2    #pragma: no cover
import lzma   #pragma: no cover

class RawFile(object):#pragma: no cover
    def __init__(self,filename): 
        self.filename = filename
        if filename.endswith('.gz'): 
            self.handle = gzip.open(filename,'rt')
        elif filename.endswith('bz2'): 
            self.handle = bz2.open(filename,'rt')
        elif filename.endswith('xz'): 
            self.handle = lzma.open(filenaem,'rt')
        else:
            self.handle = open(filename,'r')
    def __enter__(self): 
        return self.handle 
    def __exit__(self,dtype,value,traceback): 
        self.handle.close() 

[((9, 26, 9, 50), 'gzip.open', 'gzip.open', ({(9, 36, 9, 44): 'filename', (9, 45, 9, 49): '"""rt"""'}, {}), "(filename, 'rt')", False, 'import gzip\n'), ((11, 26, 11, 49), 'bz2.open', 'bz2.open', ({(11, 35, 11, 43): 'filename', (11, 44, 11, 48): '"""rt"""'}, {}), "(filename, 'rt')", False, 'import bz2\n'), ((13, 26, 13, 50), 'lzma.open', 'lzma.open', ({(13, 36, 13, 44): 'filenaem', (13, 45, 13, 49): '"""rt"""'}, {}), "(filenaem, 'rt')", False, 'import lzma\n')]