Skip to content

Commit

Permalink
desiconda normpath and fix 'is not' SyntaxWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bailey authored and Stephen Bailey committed Aug 4, 2020
1 parent 01c974a commit 572bc3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py/desiutil/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def anaconda_version(self):
The DESI+Anaconda version.
"""
try:
desiconda = os.environ['DESICONDA']
desiconda = os.path.normpath(os.environ['DESICONDA'])
except KeyError:
return 'current'
try:
Expand Down
4 changes: 2 additions & 2 deletions py/desiutil/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def init_modules(moduleshome=None, method=False, command=False):
with open(dot_modulespath, 'r') as f:
for line in f.readlines():
line = re.sub("#.*$", '', line.strip())
if line is not '':
if line != '':
path.append(line)
os.environ['MODULEPATH'] = ':'.join(path)
modulerc = os.path.join(moduleshome, 'init', 'modulerc')
Expand All @@ -60,7 +60,7 @@ def init_modules(moduleshome=None, method=False, command=False):
with open(modulerc, 'r') as f:
for line in f.readlines():
line = re.sub("#.*$", '', line.strip())
if line is not '' and line.startswith('module use'):
if line != '' and line.startswith('module use'):
p = os.path.expanduser(line.replace('module use ', '').strip())
path.append(p)
os.environ['MODULEPATH'] = ':'.join(path)
Expand Down

0 comments on commit 572bc3c

Please sign in to comment.