Skip to content

Commit

Permalink
Use os.walk for old Pythons
Browse files Browse the repository at this point in the history
  • Loading branch information
llimeht committed Dec 4, 2024
1 parent 6378cdc commit 2104df5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/sphinx-docs/collect_sphinx_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Script to collect sphinx sources for building
"""
import os
from pathlib import Path
import shutil
from distutils.dir_util import copy_tree
Expand Down Expand Up @@ -106,9 +107,10 @@ def retrieve_user_docs():
print("=== Retrieve User Docs ===")

# Copy documentation files from sas/.../media to the sphinx directory
for root, dirs, _ in SASVIEW_MEDIA_SOURCE.walk():
for root, dirs, _ in os.walk(SASVIEW_MEDIA_SOURCE):
# CRUFT: from 3.12, use SASVIEW_MEDIA_SOURCE.walk()
if 'media' in dirs:
source_dir = (root / "media").resolve()
source_dir = (Path(root) / "media").resolve()
relative = source_dir.relative_to(SASVIEW_MEDIA_SOURCE).parent
dest_dir = SPHINX_SOURCE / "user" / relative

Expand Down

0 comments on commit 2104df5

Please sign in to comment.