Skip to content

Commit df709e3

Browse files
authored
Merge pull request #993 from freyes/fix-syntax
#993 #### Description The walrus operator (`:=`) was introduced in Python 3.8, the use of it in the `2.9` branch breaks python 3.6 compatibility which is the version used in Ubuntu 18.04 (Bionic). https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions #### QA Steps 1. Install python-libjuju in python 3.6 2. python3 -c "import juju.utils" ``` virtualenv -p /usr/bin/python3.6 /tmp/myvenv source /tmp/myvenv/bin/activate python3 setup.py install python3 -c "import juju.utils" ``` All CI tests need to pass. #### Notes & Discussion This regression was introduced by #975
2 parents 4172626 + 4ca78fc commit df709e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

juju/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def juju_config_dir():
4949
config_dir = Path('~/.local/share/juju')
5050

5151
# Check $JUJU_DATA
52-
if juju_data := os.environ.get('JUJU_DATA'):
53-
config_dir = Path(juju_data)
52+
if os.environ.get('JUJU_DATA'):
53+
config_dir = Path(os.environ.get('JUJU_DATA'))
5454
# Secondly check: $XDG_DATA_HOME for ~/.local/share
55-
elif xdg_data_home := os.environ.get('XDG_DATA_HOME'):
56-
config_dir = Path(xdg_data_home) / 'juju'
55+
elif os.environ.get('XDG_DATA_HOME'):
56+
config_dir = Path(os.environ.get('XDG_DATA_HOME')) / 'juju'
5757

5858
return str(config_dir.expanduser().resolve())
5959

0 commit comments

Comments
 (0)