#NEWLINE# @ contextmanager #NEWLINE# def open( self , mode = 'r' ) : #NEWLINE# #INDENT# if ( not mode . startswith ( 'r' ) ) : #NEWLINE# #INDENT# raise ArgumentError ( 'source is read-only' ) #NEWLINE# #UNINDENT# f = urlopen ( * self . args , ** self . kwargs ) #NEWLINE# try : #NEWLINE# #INDENT# ( yield f ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( )