MCPcopy Index your code
hub / github.com/python/cpython / save_and_restore

Method save_and_restore

Lib/test/test_http_cookiejar.py:1885–1893  ·  view source on GitHub ↗
(cj, ignore_discard)

Source from the content-addressed store, hash-verified

1883 cookie.set_nonstandard_attr("HTTPOnly", "")
1884
1885 def save_and_restore(cj, ignore_discard):
1886 try:
1887 cj.save(ignore_discard=ignore_discard)
1888 new_c = MozillaCookieJar(filename,
1889 DefaultCookiePolicy(rfc2965=True))
1890 new_c.load(ignore_discard=ignore_discard)
1891 finally:
1892 os_helper.unlink(filename)
1893 return new_c
1894
1895 new_c = save_and_restore(c, True)
1896 self.assertEqual(len(new_c), 6) # none discarded

Callers

nothing calls this directly

Calls 5

MozillaCookieJarClass · 0.90
DefaultCookiePolicyClass · 0.90
saveMethod · 0.45
loadMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected