Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Added informative message when trying to use trackref and it's not enabled

Pablo Hoffman34fcf6ba5b24
diff --git a/scrapy/utils/trackref.py b/scrapy/utils/trackref.py
index 86dbc085b..a9df06946 100644
--- a/scrapy/utils/trackref.py
+++ b/scrapy/utils/trackref.py
@@ -34,6 +34,9 @@ if not settings.getbool('TRACK_REFS'):
object_ref = object
def print_live_refs():
+ if object_ref is object:
+ print "The trackref module is disabled. Use TRACK_REFS setting to enable it."
+ return
print "Live References"
print
now = time()