summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-01-11 17:01:35 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2023-01-11 17:01:35 +0000
commit2be567abcd6c2b6e30055feed5313a6a6bb3b1fc (patch)
tree1a5d275275c04a87afcbd060d3ba74328973ed23
parentea531c1bc0309635d331e3f952206579837e2e67 (diff)
parentd51c100504361362ec257f4ad48fe20af609671b (diff)
downloadpython-setuptools-git-2be567abcd6c2b6e30055feed5313a6a6bb3b1fc.tar.gz
Merge: Fixes incomplete getattr statement (#3714)
-rw-r--r--changelog.d/3713.misc.rst2
-rw-r--r--setuptools/config/pyprojecttoml.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/3713.misc.rst b/changelog.d/3713.misc.rst
new file mode 100644
index 00000000..b5d07f07
--- /dev/null
+++ b/changelog.d/3713.misc.rst
@@ -0,0 +1,2 @@
+Fixed incomplete ``getattr`` statement that caused problems when accessing
+undefined attribute.
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py
index d995f0bc..fee6fac6 100644
--- a/setuptools/config/pyprojecttoml.py
+++ b/setuptools/config/pyprojecttoml.py
@@ -112,7 +112,7 @@ def read_configuration(
# `ini2toml` backfills include_package_data=False when nothing is explicitly given,
# therefore setting a default here is backwards compatible.
orig_setuptools_table = setuptools_table.copy()
- if dist and getattr(dist, "include_package_data") is not None:
+ if dist and getattr(dist, "include_package_data", None) is not None:
setuptools_table.setdefault("include-package-data", dist.include_package_data)
else:
setuptools_table.setdefault("include-package-data", True)