diff options
-rw-r--r-- | Lib/distutils/dist.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 92cb832..c71cb36 100644 --- a/Lib/distutils/dist.py +++ b/Lib/distutils/dist.py @@ -12,6 +12,12 @@ __revision__ = "$Id$" import sys, os, string, re from types import * from copy import copy + +try: + import warnings +except: + warnings = None + from distutils.errors import * from distutils.fancy_getopt import FancyGetopt, translate_longopt from distutils.util import check_environ, strtobool, rfc822_escape @@ -206,8 +212,11 @@ class Distribution: elif hasattr(self, key): setattr(self, key, val) else: - raise DistutilsSetupError, \ - "invalid distribution option '%s'" % key + msg = "Unknown distribution option: %s" % repr(key) + if warnings is not None: + warnings.warn(msg) + else: + sys.stderr.write(msg + "\n") self.finalize_options() |