[Python-checkins] r45517 - in sandbox/trunk/setuptools: pkg_resources.py setuptools/tests/api_tests.txt

phillip.eby python-checkins at python.org
Tue Apr 18 05:29:11 CEST 2006


Author: phillip.eby
Date: Tue Apr 18 05:29:10 2006
New Revision: 45517

Modified:
   sandbox/trunk/setuptools/pkg_resources.py
   sandbox/trunk/setuptools/setuptools/tests/api_tests.txt
Log:
Make errors __repr__ the same as the default exception repr in Python 
2.5, so doctests will work right.  :(


Modified: sandbox/trunk/setuptools/pkg_resources.py
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.py	(original)
+++ sandbox/trunk/setuptools/pkg_resources.py	Tue Apr 18 05:29:10 2006
@@ -82,6 +82,8 @@
 ]
 class ResolutionError(Exception):
     """Abstract base for dependency resolution errors"""
+    def __repr__(self):
+        return self.__class__.__name__+repr(self.args)
 
 class VersionConflict(ResolutionError):
     """An already-installed version conflicts with the requested version"""
@@ -160,8 +162,6 @@
 darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)")
 
 
-
-
 def compatible_platforms(provided,required):
     """Can code for the `provided` platform run on the `required` platform?
 

Modified: sandbox/trunk/setuptools/setuptools/tests/api_tests.txt
==============================================================================
--- sandbox/trunk/setuptools/setuptools/tests/api_tests.txt	(original)
+++ sandbox/trunk/setuptools/setuptools/tests/api_tests.txt	Tue Apr 18 05:29:10 2006
@@ -274,13 +274,13 @@
 
     >>> ws.add(foo12)   # this will conflict with Foo 1.4
     >>> ws.find_plugins(plugins)
-    ([JustATest 0.99, Foo 1.2 (f12)], {Foo 1.4 (f14): <...VersionConflict...>})
+    ([JustATest 0.99, Foo 1.2 (f12)], {Foo 1.4 (f14): VersionConflict(...)})
 
 But if you disallow fallbacks, the failed plugin will be skipped instead of
 trying older versions::
 
     >>> ws.find_plugins(plugins, fallback=False)
-    ([JustATest 0.99], {Foo 1.4 (f14): <...VersionConflict...>})
+    ([JustATest 0.99], {Foo 1.4 (f14): VersionConflict(...)})
 
 
 


More information about the Python-checkins mailing list