Skip to content

Commit 6e65fc1

Browse files
STY: Apply ruff/pyupgrade rule UP024
UP024 Replace aliased errors with `OSError`
1 parent a54ca86 commit 6e65fc1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nipype/interfaces/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def copytree(src, dst, use_hardlink=False):
8484
hashmethod="content",
8585
use_hardlink=use_hardlink,
8686
)
87-
except (OSError, os.error) as why:
87+
except OSError as why:
8888
errors.append((srcname, dstname, str(why)))
8989
# catch the Error from the recursive copytree so that we can
9090
# continue with other files

nipype/pipeline/engine/workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def disconnect(self, *args):
289289
for srcnode, dstnode, conn in connection_list:
290290
logger.debug("disconnect(): %s->%s %s", srcnode, dstnode, str(conn))
291291
if self in [srcnode, dstnode]:
292-
raise IOError(
292+
raise OSError(
293293
"Workflow connect cannot contain itself as node: src[%s] "
294294
"dest[%s] workflow[%s]"
295295
) % (srcnode, dstnode, self.name)

0 commit comments

Comments
 (0)