Skip to content

Commit

Permalink
g.extension: use copytree from shutil for py >= 3.8 (OSGeo#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsbl authored and neteler committed Nov 7, 2023
1 parent e2b4699 commit a4e0952
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/g.extension/g.extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@
import tempfile
import json
import xml.etree.ElementTree as etree
from distutils.dir_util import copy_tree

if sys.version_info.major == 3 and sys.version_info.minor < 8:
from distutils.dir_util import copy_tree
else:
from functools import partial

copy_tree = partial(shutil.copytree, dirs_exist_ok=True)

from six.moves.urllib import request as urlrequest
from six.moves.urllib.error import HTTPError, URLError
Expand Down

0 comments on commit a4e0952

Please sign in to comment.