(name, kwargs)
| 167 | |
| 168 | |
| 169 | def create_unexpected_kwargs_error(name, kwargs): |
| 170 | quoted_kwargs = [f"'{k}'" for k in sorted(kwargs)] |
| 171 | text = [f"{name}() "] |
| 172 | if len(quoted_kwargs) == 1: |
| 173 | text.append("got an unexpected keyword argument ") |
| 174 | else: |
| 175 | text.append("got unexpected keyword arguments ") |
| 176 | text.append(', '.join(quoted_kwargs)) |
| 177 | return TypeError(''.join(text)) |
| 178 | |
| 179 | |
| 180 | class MissingContextParameter(DockerException): |