mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Do not read selfcheck state file when saving.
This commit is contained in:
parent
c6c2ee433b
commit
9928409b2f
|
@ -78,15 +78,13 @@ class SelfCheckState(object):
|
|||
|
||||
# Attempt to write out our version check file
|
||||
with lockfile.LockFile(self.statefile_path):
|
||||
if os.path.exists(self.statefile_path):
|
||||
with open(self.statefile_path) as statefile:
|
||||
state = json.load(statefile)
|
||||
else:
|
||||
state = {}
|
||||
|
||||
state[self.key] = {
|
||||
"last_check": current_time.strftime(SELFCHECK_DATE_FMT),
|
||||
"pypi_version": pypi_version,
|
||||
# Since we have a prefix-specific state file, we can just
|
||||
# overwrite whatever is there, no need to check.
|
||||
state = {
|
||||
self.key: {
|
||||
"last_check": current_time.strftime(SELFCHECK_DATE_FMT),
|
||||
"pypi_version": pypi_version,
|
||||
},
|
||||
}
|
||||
|
||||
with open(self.statefile_path, "w") as statefile:
|
||||
|
|
|
@ -197,7 +197,6 @@ def test_self_check_state(monkeypatch, tmpdir):
|
|||
assert fake_lock.calls == [pretend.call(expected_path)]
|
||||
|
||||
assert fake_open.calls == [
|
||||
pretend.call(expected_path),
|
||||
pretend.call(expected_path),
|
||||
pretend.call(expected_path, 'w'),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue