Skip to content

Commit

Permalink
Merge pull request #3183 from mwichmann/typefixes
Browse files Browse the repository at this point in the history
Typefixes
  • Loading branch information
bdbaddog committed Dec 31, 2018
2 parents 2e684c2 + 40dd151 commit 40f85c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
- Add Textfile/Substfile to default environment. (issue #3147)
- sconsign: a couple of python3 fixes; be more tolerant of implicit
entries which have no signatures; minor PEP8 changes.
- Fix a couple of type mistakes (list-> string, filter type -> list)
- Fix a couple of type mistakes in packaging tools: list-> string in msi,
filter type -> list in ipk

From Bernhard M. Wiedemann:
- Update SCons' internal scons build logic to allow overriding build date
Expand Down
8 changes: 6 additions & 2 deletions src/engine/SCons/Tool/packaging/ipk.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"

import os

import SCons.Builder
import SCons.Node.FS
import os
import SCons.Util

from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

Expand Down Expand Up @@ -119,7 +121,9 @@ def open_file(needle, haystack):
try:
return opened_files[needle]
except KeyError:
file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0]
files = filter(lambda x: x.get_path().rfind(needle) != -1, haystack)
# Py3: filter returns an iterable, not a list
file = list(files)[0]
opened_files[needle]=open(file.get_abspath(), 'w')
return opened_files[needle]

Expand Down
6 changes: 3 additions & 3 deletions src/engine/SCons/Tool/packaging/msi.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def convert_to_id(s, id_set):
"""
charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz0123456789_.'
if s[0] in '0123456789.':
s += '_'+s
id = [c for c in s if c in charset]
s = '_' + s
id = ''.join([c for c in s if c in charset])

# did we already generate an id for this file?
try:
Expand Down Expand Up @@ -108,7 +108,7 @@ def gen_dos_short_file_name(file, filename_set):

# strip forbidden characters.
forbidden = '."/[]:;=, '
fname = [c for c in fname if c not in forbidden]
fname = ''.join([c for c in fname if c not in forbidden])

# check if we already generated a filename with the same number:
# thisis1.txt, thisis2.txt etc.
Expand Down

0 comments on commit 40f85c3

Please sign in to comment.