Skip to content

Commit 233b82c

Browse files
Fix rez.system is_production_rez_install to handle forward slash paths under windows. (#1899)
This allows to import rez module from paths with forward slashes. The following code printed "False" before the fix: ``` import sys sys.path.append('C:/rez_test/Lib/site-packages') from rez.system import system print( 'is_production_rez_install', system.is_production_rez_install ) ``` --------- Signed-off-by: Michal Fratczak <[email protected]> Signed-off-by: Jean-Christophe Morin <[email protected]> Co-authored-by: Jean-Christophe Morin <[email protected]>
1 parent 6d63378 commit 233b82c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rez/system.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ def rez_bin_path(self):
207207
#
208208
import rez
209209
module_path = rez.__path__[0]
210+
# Best effort attempt at converting slashes to the current
211+
# platform native slash. (for example, forward to backward).
212+
module_path = os.path.normpath(module_path)
210213

211214
parts = module_path.split(os.path.sep)
212215
parts_lower = module_path.lower().split(os.path.sep)

0 commit comments

Comments
 (0)