summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/acquire-item.cc7
-rw-r--r--python/acquire.cc5
-rw-r--r--python/apt_pkgmodule.cc5
-rw-r--r--python/cache.cc17
-rw-r--r--python/cdrom.cc12
-rw-r--r--python/depcache.cc19
-rw-r--r--python/generic.cc3
-rw-r--r--python/generic.h1
-rw-r--r--python/pkgmanager.cc7
-rw-r--r--python/pkgrecords.cc7
-rw-r--r--python/pkgsrcrecords.cc7
-rw-r--r--python/sourcelist.cc7
-rw-r--r--python/tag.cc14
13 files changed, 46 insertions, 65 deletions
diff --git a/python/acquire-item.cc b/python/acquire-item.cc
index e94ea352..4b7dc34d 100644
--- a/python/acquire-item.cc
+++ b/python/acquire-item.cc
@@ -320,10 +320,9 @@ char *doc_GetPkgAcqFile =
"GetPkgAcqFile(pkgAquire, uri[, md5, size, descr, shortDescr, destDir, destFile]) -> PkgAcqFile\n";
PyObject *GetPkgAcqFile(PyObject *Self, PyObject *Args, PyObject * kwds)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgAcqFile() is "
- "deprecated. Please see apt_pkg.AcquireFile() for the "
- "replacement", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgAcqFile() is "
+ "deprecated. Please see apt_pkg.AcquireFile() for the "
+ "replacement", 1);
PyObject *pyfetcher;
char *uri, *md5, *descr, *shortDescr, *destDir, *destFile;
int size = 0;
diff --git a/python/acquire.cc b/python/acquire.cc
index 1d750f37..6f9a1412 100644
--- a/python/acquire.cc
+++ b/python/acquire.cc
@@ -404,9 +404,8 @@ PyTypeObject PyAcquire_Type = {
#ifdef COMPAT_0_7
PyObject *GetAcquire(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetAcquire() is deprecated."
- " Please see apt_pkg.Acquire() for the replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetAcquire() is deprecated."
+ " Please see apt_pkg.Acquire() for the replacement.", 1);
return PkgAcquireNew(&PyAcquire_Type,Args,0);
}
#endif
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index c6353fcc..a1e9ada0 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -54,9 +54,8 @@ static PyObject *py_gettext(PyObject *self, PyObject *Args) {
static char *doc_newConfiguration = "Construct a configuration instance";
static PyObject *newConfiguration(PyObject *self,PyObject *args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is "
- "deprecated. Use apt_pkg.Configuration() instead.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is "
+ "deprecated. Use apt_pkg.Configuration() instead.", 1);
return CppPyObject_NEW<Configuration*>(NULL, &PyConfiguration_Type, new Configuration());
}
#endif
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
diff --git a/python/cdrom.cc b/python/cdrom.cc
index e6cc8e29..7f89e9d3 100644
--- a/python/cdrom.cc
+++ b/python/cdrom.cc
@@ -81,10 +81,9 @@ static PyObject *cdrom_ident(PyObject *Self,PyObject *Args)
#ifdef COMPAT_0_7
static PyObject *cdrom_ident_old(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "Method 'Ident' of the "
- "'apt_pkg.Cdrom' object is deprecated, use 'ident' instead.",
- 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "Method 'Ident' of the "
+ "'apt_pkg.Cdrom' object is deprecated, use 'ident' instead.",
+ 1);
pkgCdrom &Cdrom = GetCpp<pkgCdrom>(Self);
PyObject *pyCdromProgressInst = 0;
@@ -169,9 +168,8 @@ PyTypeObject PyCdrom_Type = {
#ifdef COMPAT_0_7
PyObject *GetCdrom(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCdrom() is deprecated. "
- "Please see apt_pkg.Cdrom() for the replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCdrom() is deprecated. "
+ "Please see apt_pkg.Cdrom() for the replacement.", 1);
return cdrom_new(&PyCdrom_Type,Args,0);
}
#endif
diff --git a/python/depcache.cc b/python/depcache.cc
index e7d7d946..cd098f2f 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -766,9 +766,8 @@ PyTypeObject PyDepCache_Type =
#ifdef COMPAT_0_7
PyObject *GetDepCache(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetDepCache() is deprecated"
- ". Please see apt_pkg.DepCache() for the replacement.",1);
+ PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetDepCache() is deprecated"
+ ". Please see apt_pkg.DepCache() for the replacement.",1);
return PkgDepCacheNew(&PyDepCache_Type,Args,0);
}
#endif
@@ -801,10 +800,9 @@ static PyObject *PkgProblemResolverNew(PyTypeObject *type,PyObject *Args,PyObjec
#ifdef COMPAT_0_7
PyObject *GetPkgProblemResolver(PyObject *Self,PyObject *Args) {
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgProblemResolver() is"
- " deprecated. Please see apt_pkg.ProblemResolver() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgProblemResolver() is"
+ " deprecated. Please see apt_pkg.ProblemResolver() for the "
+ "replacement.", 1);
return PkgProblemResolverNew(&PyProblemResolver_Type,Args,0);
}
#endif
@@ -1093,10 +1091,9 @@ PyTypeObject PyActionGroup_Type =
#ifdef COMPAT_0_7
PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgActionGroup() is "
- "deprecated. Please see apt_pkg.ActionGroup() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgActionGroup() is "
+ "deprecated. Please see apt_pkg.ActionGroup() for the "
+ "replacement.", 1);
return PkgActionGroupNew(&PyActionGroup_Type,Args,0);
}
#endif
diff --git a/python/generic.cc b/python/generic.cc
index 0719d1bb..e04743ff 100644
--- a/python/generic.cc
+++ b/python/generic.cc
@@ -102,8 +102,7 @@ PyObject *_PyAptObject_getattro(PyObject *self, PyObject *attr) {
strlen(attrname) + 66];
sprintf(warning_string, "Attribute '%s' of the '%s' object is "
"deprecated, use '%s' instead.", attrname, cls, newattrname);
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, warning_string, 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, warning_string, 1);
delete[] warning_string;
} else {
Py_XINCREF(ptype);
diff --git a/python/generic.h b/python/generic.h
index 98c6d82b..31c1bc2d 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -31,7 +31,6 @@
#include <string>
#include <iostream>
#include <new>
-#include <cstdlib>
#if PYTHON_API_VERSION < 1013
typedef int Py_ssize_t;
diff --git a/python/pkgmanager.cc b/python/pkgmanager.cc
index df66c8c7..95e8c27e 100644
--- a/python/pkgmanager.cc
+++ b/python/pkgmanager.cc
@@ -39,10 +39,9 @@ static PyObject *PkgManagerNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
#ifdef COMPAT_0_7
PyObject *GetPkgManager(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPackageManager() is "
- "deprecated. Please see apt_pkg.PackageManager() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPackageManager() is "
+ "deprecated. Please see apt_pkg.PackageManager() for the "
+ "replacement.", 1);
return PkgManagerNew(&PyPackageManager_Type,Args,0);
}
#endif
diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc
index efa99b62..8d2cb502 100644
--- a/python/pkgrecords.cc
+++ b/python/pkgrecords.cc
@@ -221,10 +221,9 @@ PyTypeObject PyPackageRecords_Type =
#ifdef COMPAT_0_7
PyObject *GetPkgRecords(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgRecords() is "
- "deprecated. Please see apt_pkg.Records() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgRecords() is "
+ "deprecated. Please see apt_pkg.Records() for the "
+ "replacement.", 1);
return PkgRecordsNew(&PyPackageRecords_Type,Args,0);
}
#endif
diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc
index da3d0e04..aad3ef7e 100644
--- a/python/pkgsrcrecords.cc
+++ b/python/pkgsrcrecords.cc
@@ -317,10 +317,9 @@ PyTypeObject PySourceRecords_Type =
#ifdef COMPAT_0_7
PyObject *GetPkgSrcRecords(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSrcRecords() is "
- "deprecated. Please see apt_pkg.SourceRecords() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSrcRecords() is "
+ "deprecated. Please see apt_pkg.SourceRecords() for the "
+ "replacement.", 1);
if (PyArg_ParseTuple(Args,"") == 0)
return 0;
diff --git a/python/sourcelist.cc b/python/sourcelist.cc
index b04bf5cb..784b161e 100644
--- a/python/sourcelist.cc
+++ b/python/sourcelist.cc
@@ -171,10 +171,9 @@ PyTypeObject PySourceList_Type =
#ifdef COMPAT_0_7
PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSourceList() is "
- "deprecated. Please see apt_pkg.SourceList() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSourceList() is "
+ "deprecated. Please see apt_pkg.SourceList() for the "
+ "replacement.", 1);
return PkgSourceListNew(&PySourceList_Type,Args,0);
}
#endif
diff --git a/python/tag.cc b/python/tag.cc
index 5db34c1d..9fe12a1a 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -371,10 +371,9 @@ static PyObject *TagSecNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) {
char *doc_ParseSection = "ParseSection(Text) -> TagSection()\n\nDeprecated.";
PyObject *ParseSection(PyObject *self,PyObject *Args)
{
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseSection() is "
- "deprecated. Please see apt_pkg.TagSection() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseSection() is "
+ "deprecated. Please see apt_pkg.TagSection() for the "
+ "replacement.", 1);
return TagSecNew(&PyTagSection_Type,Args,0);
}
#endif
@@ -411,10 +410,9 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
#ifdef COMPAT_0_7
char *doc_ParseTagFile = "ParseTagFile(file) -> TagFile()\n\nDeprecated.";
PyObject *ParseTagFile(PyObject *self,PyObject *Args) {
- if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseTagFile() is "
- "deprecated. Please see apt_pkg.TagFile() for the "
- "replacement.", 1);
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseTagFile() is "
+ "deprecated. Please see apt_pkg.TagFile() for the "
+ "replacement.", 1);
return TagFileNew(&PyTagFile_Type,Args,0);
}
#endif