Skip to content

Commit

Permalink
PY39: Define strict zip if not builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jul 29, 2024
1 parent dac204c commit b297129
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions niworkflows/interfaces/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import shutil
import os
import re
import sys

import nibabel as nb
import numpy as np
Expand Down Expand Up @@ -64,6 +65,15 @@
LOGGER = logging.getLogger("nipype.interface")


if sys.version_info < (3, 10): # PY39
builtin_zip = zip

def zip(*args, strict=False):
if strict and any(len(args[0]) != len(arg) for arg in args):
raise ValueError("strict_zip() requires all arguments to have the same length")

Check warning on line 73 in niworkflows/interfaces/bids.py

View check run for this annotation

Codecov / codecov/patch

niworkflows/interfaces/bids.py#L73

Added line #L73 was not covered by tests
return builtin_zip(*args)


def _none():
return None

Expand Down

0 comments on commit b297129

Please sign in to comment.