Mercurial > hg
comparison mercurial/osutil.c @ 13736:f3c4421e121c
osutil: fix up check-code issues
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 23 Mar 2011 09:41:58 -0500 |
parents | 16118b4859a1 |
children | 26f8844d1757 |
comparison
equal
deleted
inserted
replaced
13735:ce341da8537c | 13736:f3c4421e121c |
---|---|
517 #ifdef __APPLE__ | 517 #ifdef __APPLE__ |
518 #import <ApplicationServices/ApplicationServices.h> | 518 #import <ApplicationServices/ApplicationServices.h> |
519 | 519 |
520 static PyObject *isgui(PyObject *self) | 520 static PyObject *isgui(PyObject *self) |
521 { | 521 { |
522 CFDictionaryRef dict = CGSessionCopyCurrentDictionary(); | 522 CFDictionaryRef dict = CGSessionCopyCurrentDictionary(); |
523 | 523 |
524 if (dict != NULL) { | 524 if (dict != NULL) { |
525 CFRelease(dict); | 525 CFRelease(dict); |
526 return Py_True; | 526 return Py_True; |
527 } else { | 527 } else { |
528 return Py_False; | 528 return Py_False; |
529 } | 529 } |
530 } | 530 } |
531 #endif | 531 #endif |
532 | 532 |
533 static char osutil_doc[] = "Native operating system services."; | 533 static char osutil_doc[] = "Native operating system services."; |
534 | 534 |
539 {"posixfile", (PyCFunction)posixfile, METH_VARARGS | METH_KEYWORDS, | 539 {"posixfile", (PyCFunction)posixfile, METH_VARARGS | METH_KEYWORDS, |
540 "Open a file with POSIX-like semantics.\n" | 540 "Open a file with POSIX-like semantics.\n" |
541 "On error, this function may raise either a WindowsError or an IOError."}, | 541 "On error, this function may raise either a WindowsError or an IOError."}, |
542 #endif | 542 #endif |
543 #ifdef __APPLE__ | 543 #ifdef __APPLE__ |
544 { | 544 { |
545 "isgui", (PyCFunction)isgui, METH_NOARGS, | 545 "isgui", (PyCFunction)isgui, METH_NOARGS, |
546 "Is a CoreGraphics session available?" | 546 "Is a CoreGraphics session available?" |
547 }, | 547 }, |
548 #endif | 548 #endif |
549 {NULL, NULL} | 549 {NULL, NULL} |
550 }; | 550 }; |
551 | 551 |
552 #ifdef IS_PY3K | 552 #ifdef IS_PY3K |