summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornima <nima@abc39116-655e-4be6-ad55-d661dc543056>2008-12-18 13:45:37 +0000
committernima <nima@abc39116-655e-4be6-ad55-d661dc543056>2008-12-18 13:45:37 +0000
commit2343c69ba224db0f6c7cca4be5496ce1f3382baf (patch)
treee6803c0814b112e7bf3ada975aebeb7cb8979c02 /src
parent8a49e58086274526d2526edade1d53ee02af2820 (diff)
downloadpython-dmidecode-2343c69ba224db0f6c7cca4be5496ce1f3382baf.tar.gz
python-dmidecode-2343c69ba224db0f6c7cca4be5496ce1f3382baf.tar.xz
python-dmidecode-2343c69ba224db0f6c7cca4be5496ce1f3382baf.zip
The dmidecode.type() call not takes ints, not strings.
Adding an example directory. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@115 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'src')
-rw-r--r--src/dmidecodemodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dmidecodemodule.c b/src/dmidecodemodule.c
index 5ede36e..7871a89 100644
--- a/src/dmidecodemodule.c
+++ b/src/dmidecodemodule.c
@@ -148,9 +148,12 @@ static PyObject* dmidecode_get_cache(PyObject *self, PyObject *args) { retur
static PyObject* dmidecode_get_connector(PyObject *self, PyObject *args) { return dmidecode_get(self, "connector"); }
static PyObject* dmidecode_get_slot(PyObject *self, PyObject *args) { return dmidecode_get(self, "slot"); }
static PyObject* dmidecode_get_type(PyObject *self, PyObject *args) {
- const char *s;
- if(PyArg_ParseTuple(args, (char *)"s", &s))
+ long unsigned int lu;
+ if(PyArg_ParseTuple(args, (char *)"i", &lu)) {
+ char s[8];
+ sprintf(s, "%lu", lu);
return dmidecode_get(self, s);
+ }
return Py_None;
}