Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: Fix ast library type and attribute deprecation warnings #1332

Merged
merged 1 commit into from
Jun 27, 2024

Commits on Jun 27, 2024

  1. RF: Fix ast library type and attribute deprecation warnings

    Fix `ast` library type and attribute deprecation warnings.
    
    Fixes:
    ```
    /home/runner/work/nibabel/nibabel/nibabel/nicom/ascconv.py:177:
     DeprecationWarning: ast.Num is deprecated and will be removed in Python 3.14; use ast.Constant instead
      if isinstance(value, ast.Num):
    
    /home/runner/work/nibabel/nibabel/nibabel/nicom/ascconv.py:179:
     DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
      if isinstance(value, ast.Str):
    
    /home/runner/work/nibabel/nibabel/nibabel/nicom/ascconv.py:180:
     DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
      return value.s
    
    /home/runner/work/nibabel/nibabel/nibabel/nicom/ascconv.py:94:
     DeprecationWarning: Attribute n is deprecated and will be removed in Python 3.14; use value instead
      index = target.slice.n
    
    /home/runner/work/nibabel/nibabel/nibabel/nicom/ascconv.py:182:
     DeprecationWarning: Attribute n is deprecated and will be removed in Python 3.14; use value instead
      return -value.operand.n
    ```
    
    raised for example in:
    https://github.com/nipy/nibabel/actions/runs/9637811213/job/26577586721#step:7:207
    
    Documentation:
    https://docs.python.org/3/library/ast.html
    jhlegarreta committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    94e3e83 View commit details
    Browse the repository at this point in the history