소스 검색

Nested with

master
Ricardo Branco 6 년 전
부모
커밋
3742bc9e49
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2
    4
      clean_registry.py

+ 2
- 4
clean_registry.py 파일 보기

@@ -204,10 +204,8 @@ class RegistryCleaner():
204 204
         try:
205 205
             with BytesIO(
206 206
                 b"".join(_ for _ in self.docker.api.get_archive(self.container, path)[0])
207
-            ) as buf:
208
-                with tarfile.open(fileobj=buf) as tar:
209
-                    with tar.extractfile(os.path.basename(path)) as infile:
210
-                        data = infile.read()
207
+            ) as buf, tarfile.open(fileobj=buf) as tar, tar.extractfile(os.path.basename(path)) as infile:
208
+                data = infile.read()
211 209
         except NotFound as err:
212 210
             error(err)
213 211
         return data

Loading…
취소
저장