def temporary_mount(filesystem, options=None):
 mountpoint = temporary_directory()
 try:
  mounted_fs = mount(filesystem, mountpoint, options=options)
 except:
  mountpoint.remove()
  raise
 return TemporaryMountedFilesystem(fs=mounted_fs)

def temporary_mount ( filesystem , options = None ) : mountpoint = temporary_directory ( ) try : mounted_fs = mount ( filesystem , mountpoint , options = options ) except : mountpoint . remove ( ) raise return TemporaryMountedFilesystem ( fs = mounted_fs )
mount filesystem at a temporary mountpoint with options .