diff options
Diffstat (limited to 'python/cache.cc')
| -rw-r--r-- | python/cache.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/python/cache.cc b/python/cache.cc index b0cfb469..e31f6a65 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -120,9 +120,8 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) #ifdef COMPAT_0_7 static PyObject *PkgCacheClose(PyObject *Self,PyObject *Args) { - if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) - PyErr_WarnEx(PyExc_DeprecationWarning, "Cache.Close() is deprecated, " - "because it causes segfaults. Delete the Cache instead.", 1); + PyErr_WarnEx(PyExc_DeprecationWarning, "Cache.Close() is deprecated, " + "because it causes segfaults. Delete the Cache instead.", 1); PyObject *CacheFilePy = GetOwner<pkgCache*>(Self); pkgCacheFile *Cache = GetCpp<pkgCacheFile*>(CacheFilePy); Cache->Close(); @@ -133,10 +132,9 @@ static PyObject *PkgCacheClose(PyObject *Self,PyObject *Args) static PyObject *PkgCacheOpen(PyObject *Self,PyObject *Args) { - if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) - PyErr_WarnEx(PyExc_DeprecationWarning, "Cache.Open() is deprecated, " - "because it causes memory leaks. Create a new Cache instead.", - 1); + PyErr_WarnEx(PyExc_DeprecationWarning, "Cache.Open() is deprecated, " + "because it causes memory leaks. Create a new Cache instead.", + 1); PyObject *CacheFilePy = GetOwner<pkgCache*>(Self); pkgCacheFile *Cache = GetCpp<pkgCacheFile*>(CacheFilePy); @@ -1478,9 +1476,8 @@ PyTypeObject PyDependencyList_Type = #ifdef COMPAT_0_7 PyObject *TmpGetCache(PyObject *Self,PyObject *Args) { - if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) - PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCache() is deprecated. " - "Please see apt_pkg.Cache() for the replacement.", 1); + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCache() is deprecated. " + "Please see apt_pkg.Cache() for the replacement.", 1); return PkgCacheNew(&PyCache_Type,Args,0); } #endif |
