[Python-checkins] python/dist/src/Lib/distutils/command build_py.py,1.41,1.42

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
Fri, 28 Feb 2003 14:03:10 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory sc8-pr-cvs1:/tmp/cvs-serv8488

Modified Files:
	build_py.py 
Log Message:
[Patch #695090 from Bernhard Herzog] Allow specifying both py_modules and packages

Index: build_py.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_py.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** build_py.py	19 Nov 2002 13:12:28 -0000	1.41
--- build_py.py	28 Feb 2003 22:03:04 -0000	1.42
***************
*** 87,109 ****
          # and 'py_modules'.  The former lets us work with whole packages, not
          # specifying individual modules at all; the latter is for
!         # specifying modules one-at-a-time.  Currently they are mutually
!         # exclusive: you can define one or the other (or neither), but not
!         # both.  It remains to be seen how limiting this is.
! 
!         # Dispose of the two "unusual" cases first: no pure Python modules
!         # at all (no problem, just return silently), and over-specified
!         # 'packages' and 'py_modules' options.
! 
!         if not self.py_modules and not self.packages:
!             return
!         if self.py_modules and self.packages:
!             raise DistutilsOptionError, \
!                   "build_py: supplying both 'packages' and 'py_modules' " + \
!                   "options is not allowed"
  
-         # Now we're down to two cases: 'py_modules' only and 'packages' only.
          if self.py_modules:
              self.build_modules()
!         else:
              self.build_packages()
  
--- 87,95 ----
          # and 'py_modules'.  The former lets us work with whole packages, not
          # specifying individual modules at all; the latter is for
!         # specifying modules one-at-a-time.
  
          if self.py_modules:
              self.build_modules()
!         if self.packages:
              self.build_packages()
  
***************
*** 277,284 ****
          'find_package_modules()' do."""
  
          if self.py_modules:
!             modules = self.find_modules()
!         else:
!             modules = []
              for package in self.packages:
                  package_dir = self.get_package_dir(package)
--- 263,270 ----
          'find_package_modules()' do."""
  
+         modules = []
          if self.py_modules:
!             modules.extend(self.find_modules())
!         if self.packages:
              for package in self.packages:
                  package_dir = self.get_package_dir(package)