Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid breaking users calling forbidden private api conanfile.__init__ #8746

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions conans/client/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def load_basic_module(self, conanfile_path, lock_python_requires=None, user=None
"""
cached = self._cached_conanfile_classes.get(conanfile_path)
if cached and cached[1] == lock_python_requires:
conanfile = cached[0](self._output, self._runner, display, user, channel,
self._requester)
conanfile = cached[0](self._output, self._runner, display, user, channel)
conanfile._conan_requester = self._requester
if hasattr(conanfile, "init") and callable(conanfile.init):
with conanfile_exception_formatter(str(conanfile), "init"):
conanfile.init()
Expand Down Expand Up @@ -85,7 +85,8 @@ def load_basic_module(self, conanfile_path, lock_python_requires=None, user=None

self._cached_conanfile_classes[conanfile_path] = (conanfile, lock_python_requires,
module)
result = conanfile(self._output, self._runner, display, user, channel, self._requester)
result = conanfile(self._output, self._runner, display, user, channel)
result._conan_requester = self._requester
if hasattr(result, "init") and callable(result.init):
with conanfile_exception_formatter(str(result), "init"):
result.init()
Expand Down
4 changes: 2 additions & 2 deletions conans/model/conan_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ConanFile(object):
# layout
layout = None

def __init__(self, output, runner, display_name="", user=None, channel=None, requester=None):
def __init__(self, output, runner, display_name="", user=None, channel=None):
# an output stream (writeln, info, warn error)
self.output = ScopedOutput(display_name, output)
self.display_name = display_name
Expand All @@ -147,7 +147,7 @@ def __init__(self, output, runner, display_name="", user=None, channel=None, req

self.compatible_packages = []
self._conan_using_build_profile = False
self._conan_requester = requester
self._conan_requester = None

self.layout = Layout()
self.buildenv_info = Environment()
Expand Down