DM-36449: Add check to test is var is there before deleting#22
DM-36449: Add check to test is var is there before deleting#22mfisherlevine merged 1 commit intomainfrom
Conversation
| # using an instrument label raises a FileNotFoundError | ||
| with unittest.mock.patch.dict('os.environ'): | ||
| del os.environ['DAF_BUTLER_REPOSITORY_INDEX'] | ||
| if 'DAF_BUTLER_REPOSITORY_INDEX' in os.environ: # can't del unless it's already there |
There was a problem hiding this comment.
It's more compact to say os.environ.pop('DAF_BUTLER_REPOSITORY_INDEX', None), but it might be less clear.
There was a problem hiding this comment.
Yeah, I think I like the explicit way in this instance.
ktlim
left a comment
There was a problem hiding this comment.
This change alone is fine. I haven't looked at any of the other code, though, and problems remain with packages in lsst_sitcom (e.g. missing summit_extras).
Yup, woke up to that fail on Jenkins. Should just be the fact that |
No description provided.