Remove os.getcwd from function signature (#31480)

fixes #29730

This is also wrong since it binds the directory at the time
of module import, rather than the one at the time of function
call.
This commit is contained in:
Massimiliano Culpo 2022-07-12 10:08:37 +02:00 committed by GitHub
parent 25f198aa91
commit 89b8d33d05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Tools to produce reports of spec installations""" """Tools to produce reports of spec installations"""
import codecs import codecs
import collections import collections
@ -281,9 +280,9 @@ def __init__(self, cls, function, format_name, args):
.format(self.format_name)) .format(self.format_name))
self.report_writer = report_writers[self.format_name](args) self.report_writer = report_writers[self.format_name](args)
def __call__(self, type, dir=os.getcwd()): def __call__(self, type, dir=None):
self.type = type self.type = type
self.dir = dir self.dir = dir or os.getcwd()
return self return self
def concretization_report(self, msg): def concretization_report(self, msg):