Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96e79fc

Browse files
committed
Check return value of get_artifact_tarball()
Fixes PYDOTORG-STAGING-68
1 parentf17ceb8 commit96e79fc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎peps/management/commands/generate_pep_pages.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ def verbose(msg):
5252

5353
withExitStack()asstack:
5454
verbose(f"== Fetching PEP artifact from{settings.PEP_ARTIFACT_URL}")
55-
temp_file=self.get_artifact_tarball(stack,verbose)
55+
temp_file=self.get_artifact_tarball(stack)
56+
ifnottemp_file:
57+
verbose("== No update to artifacts, we're done here!")
58+
return
5659
temp_dir=stack.enter_context(TemporaryDirectory())
5760
tar_ball=stack.enter_context(TarFile.open(fileobj=temp_file,mode='r:gz'))
5861
tar_ball.extractall(path=temp_dir,numeric_owner=False)
@@ -117,7 +120,7 @@ def verbose(msg):
117120

118121
verbose("== Finished")
119122

120-
defget_artifact_tarball(self,stack,verbose):
123+
defget_artifact_tarball(self,stack):
121124
artifact_url=settings.PEP_ARTIFACT_URL
122125
ifnotartifact_url.startswith(('http://','https://')):
123126
returnstack.enter_context(open(artifact_url,'rb'))
@@ -126,7 +129,6 @@ def get_artifact_tarball(self, stack, verbose):
126129
withrequests.get(artifact_url,stream=True)asr:
127130
artifact_last_modified=parsedate(r.headers['last-modified'])
128131
ifpeps_last_updated>artifact_last_modified:
129-
verbose(f"== No update to artifacts, we're done here!")
130132
return
131133

132134
temp_file=stack.enter_context(TemporaryFile())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp