diff options
author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2016-02-01 21:58:19 +0200 |
---|---|---|
committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2016-02-01 21:58:19 +0200 |
commit | cd4b3b527348aa6e96f171e90f6bc6bde5582baf (patch) | |
tree | b4df4a926226e814f408fd07834b4220b4ccda26 | |
parent | bafc1536f2a354cdb7526a3a40f580885e4dc484 (diff) | |
download | routes-cd4b3b527348aa6e96f171e90f6bc6bde5582baf.tar.gz |
Fix empty string match
-rw-r--r-- | routes/mapper.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routes/mapper.py b/routes/mapper.py index 382c01d..43372d7 100644 --- a/routes/mapper.py +++ b/routes/mapper.py @@ -713,10 +713,10 @@ class Mapper(SubMapperParent): resultdict = m.match('/joe/sixpack') """ - if not url and not environ: + if url is None and not environ: raise RoutesException('URL or environ must be provided') - if not url: + if url is None: url = environ['PATH_INFO'] result = self._match(url, environ) @@ -737,10 +737,10 @@ class Mapper(SubMapperParent): resultdict, route_obj = m.match('/joe/sixpack') """ - if not url and not environ: + if url is None and not environ: raise RoutesException('URL or environ must be provided') - if not url: + if url is None: url = environ['PATH_INFO'] result = self._match(url, environ) if self.debug: |