Skip to content

Commit 690e439

Browse files
committed
Moved conditional imports closer to actual usage
1 parent e129fc7 commit 690e439

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli50/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55

66
import argparse
77
import gettext
8-
import inflect
9-
import json
108
import os
119
import re
1210
import requests
13-
import shlex
1411
import shutil
1512
import subprocess
16-
import textwrap
1713
import tzlocal
14+
1815
from importlib.resources import files
1916
from packaging import version
2017

@@ -123,6 +120,7 @@ def main():
123120
sys.exit("No containers are running.")
124121

125122
# Ask whether to use a running container
123+
import inflect, textwrap
126124
for ID, Image, RunningFor, Status, Mounts in containers:
127125
while True:
128126
prompt = _("Log into {}, created {}, {}").format(Image, RunningFor, Status)
@@ -172,6 +170,7 @@ def main():
172170
if not args["fast"]:
173171

174172
# Remote manifest
173+
import json
175174
try:
176175
RemoteManifest = json.loads(subprocess.check_output([
177176
"docker", "manifest", "inspect", f"{IMAGE}:{args['tag']}", "--verbose"
@@ -324,6 +323,7 @@ def ports(container):
324323

325324
def pull(image, tag):
326325
"""Pull image as needed."""
326+
import json
327327
try:
328328

329329
# Get the latest manifest from registry

0 commit comments

Comments
 (0)