Skip to content

Commit

Permalink
[webkitcorepy] Provide default argument for Environment
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=245759
<rdar://100482618>

Reviewed by Dewei Zhu.

* Tools/Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/environment.py:
(Environment.get): Allow for a default argument.

Canonical link: https://commits.webkit.org/254954@main
  • Loading branch information
JonWBedard committed Sep 28, 2022
1 parent fb9116e commit cde78ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Tools/Scripts/libraries/webkitcorepy/setup.py
Expand Up @@ -30,7 +30,7 @@ def readme():

setup(
name='webkitcorepy',
version='0.13.14',
version='0.13.15',
description='Library containing various Python support classes and functions.',
long_description=readme(),
classifiers=[
Expand Down
Expand Up @@ -44,7 +44,7 @@
from webkitcorepy.editor import Editor
from webkitcorepy.file_lock import FileLock

version = Version(0, 13, 14)
version = Version(0, 13, 15)

from webkitcorepy.autoinstall import Package, AutoInstall
if sys.version_info > (3, 0):
Expand Down
Expand Up @@ -52,10 +52,10 @@ def load(self, *prefixes):
self._mapping[key] = fl.read().rstrip('\n')
return self

def get(self, key):
def get(self, key, value=None):
if key in os.environ:
return os.environ[key]
return self._mapping.get(key)
return os.environ.get(key, value)
return self._mapping.get(key, value)

def secure(self, *extra_paths):
'''Delete unused environment files in self.path along with the provided extra paths'''
Expand Down

0 comments on commit cde78ac

Please sign in to comment.