Skip to content

Commit 62a4249

Browse files
authored
Use json.encode(<struct>) (bazel-contrib#838)
1 parent b8d6b2f commit 62a4249

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/pip_install/pip_repository.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _parse_optional_attrs(rctx, args):
160160
if rctx.attr.extra_pip_args != None:
161161
args += [
162162
"--extra_pip_args",
163-
struct(arg = rctx.attr.extra_pip_args).to_json(),
163+
json.encode(struct(arg = rctx.attr.extra_pip_args)),
164164
]
165165

166166
if rctx.attr.download_only:
@@ -169,7 +169,7 @@ def _parse_optional_attrs(rctx, args):
169169
if rctx.attr.pip_data_exclude != None:
170170
args += [
171171
"--pip_data_exclude",
172-
struct(arg = rctx.attr.pip_data_exclude).to_json(),
172+
json.encode(struct(arg = rctx.attr.pip_data_exclude)),
173173
]
174174

175175
if rctx.attr.enable_implicit_namespace_pkgs:
@@ -178,7 +178,7 @@ def _parse_optional_attrs(rctx, args):
178178
if rctx.attr.environment != None:
179179
args += [
180180
"--environment",
181-
struct(arg = rctx.attr.environment).to_json(),
181+
json.encode(struct(arg = rctx.attr.environment)),
182182
]
183183

184184
return args

0 commit comments

Comments
 (0)