# HG changeset patch # User Ludovic Chabant # Date 1455507865 28800 # Node ID a4ac464a45b3c7f45d10bec47170361cc8431bf6 # Parent 7940861ff9bce972076ddcbcdb73eb9cdf303d0c internal: Remove SyntaxWarning from MacOS wrappers. diff -r 7940861ff9bc -r a4ac464a45b3 piecrust/osutil.py --- a/piecrust/osutil.py Tue Feb 09 21:52:17 2016 -0800 +++ b/piecrust/osutil.py Sun Feb 14 19:44:25 2016 -0800 @@ -9,7 +9,11 @@ glob = _system_glob.glob -if sys.platform == 'darwin': +def _wrap_fs_funcs(): + global walk + global listdir + global glob + def _walk(top, **kwargs): for dirpath, dirnames, filenames in os.walk(top, **kwargs): dirpath = _from_osx_fs(dirpath) @@ -33,9 +37,11 @@ def _to_osx_fs(s): return unicodedata.ucd_3_2_0.normalize('NFD', s) - global walk, listdir, glob - walk = _walk listdir = _listdir glob = _glob + +if sys.platform == 'darwin': + _wrap_fs_funcs() +