Skip to content

Commit

Permalink
Merge pull request #2688 from swt2c/remove_python2_six
Browse files Browse the repository at this point in the history
Remove Python 2 compatibility and use of six module
  • Loading branch information
swt2c authored Feb 4, 2025
2 parents 961d14b + a29322f commit da22777
Show file tree
Hide file tree
Showing 138 changed files with 377 additions and 5,467 deletions.
22 changes: 3 additions & 19 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
# License: wxWindows License
#----------------------------------------------------------------------

from __future__ import absolute_import

import sys
import glob
import hashlib
import optparse
import os
import pathlib
import re
import shutil
import subprocess
Expand All @@ -30,15 +29,7 @@
import textwrap
import warnings

try:
import pathlib
except ImportError:
import buildtools.backports.pathlib2 as pathlib

try:
from shutil import which
except ImportError:
from buildtools.backports.shutil_which import which
from shutil import which

try:
from setuptools.modified import newer, newer_group
Expand All @@ -55,10 +46,6 @@
import buildtools.version as version


# which version of Python is running this script
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3


# defaults
PYVER = '2.7'
Expand Down Expand Up @@ -1088,7 +1075,7 @@ def _removeSidebar(path):
tag = soup.find('div', 'document')
if tag:
tag.attrs['class'] = ['document-no-sidebar']
text = unicode(soup) if PY2 else str(soup)
text = str(soup)
with textfile_open(filename, 'wt') as f:
f.write(text)

Expand Down Expand Up @@ -1509,9 +1496,6 @@ def cmd_build_wx(options, args):
if options.jom:
build_options.append('--jom')

if PY2:
build_options.append('--no_dpi_aware')

else:
# Platform is something other than MSW
if options.osx_carbon:
Expand Down
Empty file removed buildtools/backports/__init__.py
Empty file.
Loading

0 comments on commit da22777

Please sign in to comment.