diff options
Diffstat (limited to 'pecan/routing.py')
-rw-r--r-- | pecan/routing.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pecan/routing.py b/pecan/routing.py index 17a7e40..c6abb2e 100644 --- a/pecan/routing.py +++ b/pecan/routing.py @@ -24,13 +24,25 @@ class NonCanonicalPath(Exception): self.remainder = remainder -def lookup_controller(obj, remainder, request): +def lookup_controller(obj, remainder, request=None): ''' Traverses the requested url path and returns the appropriate controller object, including default routes. Handles common errors gracefully. ''' + if request is None: + warnings.warn( + ( + "The function signature for %s.lookup_controller is changing " + "in the next version of pecan.\nPlease update to: " + "`lookup_controller(self, obj, remainder, request)`." % ( + __name__, + ) + ), + DeprecationWarning + ) + notfound_handlers = [] while True: try: |