Skip to content

Commit fd2eff0

Browse files
committed
cwltool: use _logger.warning
_logger.warn is deprecated in py3
1 parent e9c9cef commit fd2eff0

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

cwltool/draft2tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run(self, **kwargs): # type: (**Any) -> None
6262
normalizeFilesDirs(ev)
6363
self.output_callback(ev, "success")
6464
except Exception as e:
65-
_logger.warn(u"Failed to evaluate expression:\n%s",
65+
_logger.warning(u"Failed to evaluate expression:\n%s",
6666
e, exc_info=kwargs.get('debug'))
6767
self.output_callback({}, "permanentFail")
6868

@@ -537,7 +537,7 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr
537537
"class": "File" if fs_access.isfile(g) else "Directory"}
538538
for g in fs_access.glob(fs_access.join(outdir, gb))])
539539
except (OSError, IOError) as e:
540-
_logger.warn(Text(e))
540+
_logger.warning(Text(e))
541541
except:
542542
_logger.error("Unexpected error from fs_access", exc_info=True)
543543
raise

cwltool/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _execute(self, runtime, env, rm_tmpdir=True, move_outputs="move"):
240240
processStatus = "permanentFail"
241241

242242
if processStatus != "success":
243-
_logger.warn(u"[job %s] completed %s", self.name, processStatus)
243+
_logger.warning(u"[job %s] completed %s", self.name, processStatus)
244244
else:
245245
_logger.info(u"[job %s] completed %s", self.name, processStatus)
246246

cwltool/load_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def validate_document(document_loader, # type: Loader
165165
r"^(?:cwl:|https://w3id.org/cwl/cwl#)", "",
166166
workflowobj["cwlVersion"])
167167
else:
168-
_logger.warn("No cwlVersion found, treating this file as draft-2.")
168+
_logger.warning("No cwlVersion found, treating this file as draft-2.")
169169
workflowobj["cwlVersion"] = "draft-2"
170170

171171
if workflowobj["cwlVersion"] == "draft-2":

cwltool/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ def locToPath(p):
833833
stdout.flush()
834834

835835
if status != "success":
836-
_logger.warn(u"Final process status is %s", status)
836+
_logger.warning(u"Final process status is %s", status)
837837
return 1
838838
else:
839839
_logger.info(u"Final process status is %s", status)

cwltool/workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def receive_output(self, step, outputparms, final_output_callback, jobout, proce
314314
if self.processStatus != "permanentFail":
315315
self.processStatus = processStatus
316316

317-
_logger.warn(u"[%s] completed %s", step.name, processStatus)
317+
_logger.warning(u"[%s] completed %s", step.name, processStatus)
318318
else:
319319
_logger.info(u"[%s] completed %s", step.name, processStatus)
320320

@@ -381,7 +381,7 @@ def valueFromFunc(k, v): # type: (Any, Any) -> Any
381381
tot = 1
382382
emptyscatter = [shortname(s) for s in scatter if len(inputobj[s]) == 0]
383383
if emptyscatter:
384-
_logger.warn(u"[job %s] Notice: scattering over empty input in '%s'. All outputs will be empty.", step.name, "', '".join(emptyscatter))
384+
_logger.warning(u"[job %s] Notice: scattering over empty input in '%s'. All outputs will be empty.", step.name, "', '".join(emptyscatter))
385385

386386
if method == "dotproduct" or method is None:
387387
jobs = dotproduct_scatter(step, inputobj, scatter,
@@ -609,8 +609,8 @@ def static_checker(workflow_inputs, workflow_outputs, step_inputs, step_outputs)
609609
all_exception_msg = "\n".join(exception_msgs)
610610

611611
if warnings:
612-
_logger.warn("Workflow checker warning:")
613-
_logger.warn(all_warning_msg)
612+
_logger.warning("Workflow checker warning:")
613+
_logger.warning(all_warning_msg)
614614
if exceptions:
615615
raise validate.ValidationException(all_exception_msg)
616616

0 commit comments

Comments
 (0)