
92 Cal.App.2d 467 (1949)
In re ANDREW JOHNSON, on Habeas Corpus.
Crim. No. 2585. 
California Court of Appeals. First Dist., Div. One.  
June 17, 1949.
 John D. Harloe for Petitioner.
 Harry Gottesfeld as Amicus Curiae in opposition to petition.
 PETERS, P. J.
 Petition for a writ of habeas corpus.
 On November 30, 1948, in the action of Bessie Johnson versus Andrew Johnson, there was entered an amended and *468 modified order requiring Andrew to pay Bessie $50 a month for her support, $150 counsel fees, and $25 costs. Andrew failed to make the payments, and, on January 18, 1949, he was adjudged guilty of contempt for willfully failing to comply with the order. He was committed to the county jail until he did so. This order of commitment has not been attacked, and constitutes an adjudication that on January 18, 1949, Andrew had the ability to comply with the order and willfully refused to do so.
 On February 4, 1949, Andrew, purporting to act under sections 1143 to 1154 of the Code of Civil Procedure, applied to the superior court for his release from custody upon the ground that he did not, on such date, then have the ability to comply with the order. The application came on for hearing on February 8th, and was continued from then to February 21st, and finally to February 25th. On this last date he was examined as to his then ability to comply with the order, and written interrogatories were signed by him. From his evidence, given under oath, it appears that his last regular full-time employment terminated in November, 1948; that from that date until January 16, 1949, he worked but one day a week in a garage; that he owns no real or personal property of any kind; that he has no money in the bank; that he has no interest in any life insurance policy; that he owns no stocks or bonds; that no one holds any money or property for him, nor does anyone owe him any money; that he does not have a safe deposit box. Andrew was the only witness who testified, and his testimony is uncontradicted and unimpeached. The superior court, without explanation, denied the application for release from jail, and returned him to custody. This petition was then filed.
 [1] Petitioner contends that, under such circumstances, he is entitled to his release under sections 1143 to 1154 of the Code of Civil Procedure. These sections constitute the chapter of that code that is entitled "Discharge of Persons Imprisoned on Civil Process." Section 1143 provides that: "Any person confined in jail, on an execution issued on a judgment rendered in a civil action, must be discharged therefrom upon the conditions in this chapter specified." (Italics added.)
 Sections 1144 and 1145 provide for notice to and service upon the opposing party. Section 1146 provides: "At the time and place specified in the notice, such person must be taken before such judge or justice, who must examine him under oath concerning his estate and property and effects, *469 and the disposal thereof, and his ability to pay the judgment for which he is committed; and such judge or justice may also hear any other legal and pertinent evidence that may be produced by the debtor or the creditor."
 Section 1147 provides for written interrogatories to be submitted to the prisoner, and section 1148 provides: "If, upon the examination, the judge or justice is satisfied that the prisoner is entitled to his discharge, he must administer to him the following oath, to wit: 'I, __________, do solemnly swear that I have not any estate, real or personal, to the amount of fifty dollars, except such as is by law exempted from being taken in execution; and that I have not any other estate now conveyed or concealed, or in any way disposed of, with design to secure the same to my use, or to hinder, delay, or defraud my creditors, so help me God.' "
 Section 1149 provides: "After administering the oath, the judge or justice must issue an order that the prisoner be discharged from custody, and the officer, upon the service of such order, must discharge the prisoner forthwith, if he be imprisoned for no other cause." The other sections of the chapter have no direct application to the present proceeding.
 Counsel for Mrs. Johnson contends that these sections are not at all applicable to an imprisonment based upon a contempt for failing to pay alimony or support, arguing that the sections only apply where the prisoner has been committed on an execution issued on a judgment in a civil action, and not to criminal or quasi criminal contempts. The opinion in the case of In re Pillsbury, 69 Cal.App. 784 [232 P. 725], contains language, by way of dicta, that supports this view. At page 790 it is stated:
 "Finally, it is contended that the petitioner made application under section 1143 of the Code of Civil Procedure to purge himself of the contempt for which he had been imprisoned, but that the trial court upon the date set for hearing said application declined to hear any evidence and dismissed the application. It appears that counsel for respondent objected upon the ground that there was no issue before the court, and that this objection was sustained."
 "Section 1143 of the Code of Civil Procedure relates to persons confined in jail on an execution issued on a judgment in a civil action, and where his ability to comply with an order of court has previously been determined by the trial court this section is not applicable ..." *470
 On its face this reasoning is palpably unsound. If the code sections have no application where the prisoner's ability to comply with the order has previously been determined, it would mean that a prisoner who had the ability to pay when committed, but who becomes unable to pay after his commitment, would have to stay in jail for life for failing to pay alimony. Such cannot be the law. Not only was the quoted portion of the Pillsbury opinion not necessary to the decision, but the holding is directly contrary to that of several other cases and has been expressly disapproved in at least one later case. In Ellery v. Superior Court, 25 Cal.App.2d 222 [77 P.2d 280], a husband was committed for contempt for failure to pay a maintenance award. He unsuccessfully attempted to challenge his commitment by a habeas corpus petition. Shortly after he had been placed in custody he filed an application under section 1143 et seq., of the Code of Civil Procedure for an order of discharge. The trial court entertained the application and admitted the applicant to bail pending the hearing. The wife thereupon brought a proceeding in mandamus to compel dismissal of the pending application and to have the husband remanded to jail, it being her contention that the code sections mentioned have no application to a contempt imprisonment predicated on failure to pay alimony for the reason that a judgment for maintenance is not a debt. In disposing of this contention the court stated (p. 223):
 "It is well settled that such a judgment is not a debt within the meaning of section 15 of article I of the Constitution, which secures a citizen against imprisonment for debt. Nevertheless the duty of support, though not technically a debt, is an obligation which may be enforced by the process of contempt. [Citing cases.] In the Matter of the Application of Wilson, 75 Cal. 580 [17 P. 698], the question here presented was determined. There it was held that the petitioner, who in a divorce action had been ordered to pay alimony and committed for contempt on his failure to pay, was in custody under an execution, and would be entitled to his discharge under the code sections cited upon proof establishing his subsequent inability to comply with the order. The rule thus declared was referred to with tacit approval in Spencer v. Lawler, 79 Cal. 215 [21 P. 742], Ex parte Batchelder, 96 Cal. 233 [31 P. 45], and Ex parte Levin, 191 Cal. 207 [215 P. 908]. (See, also, 1 Cal.Jur., Alimony and Maintenance, sec. 108, p. 1061.) *471"
 "In this connection In re Pillsbury, 69 Cal.App. 784, 785 [232 P. 725], is cited and relied upon by petitioner; but an examination of the case shows that what was said to the contrary was unnecessary to the decision. We think it clear that the code sections apply to cases of this character; and if it be established that Ellery since his commitment has become unable to comply with the order of court, respondent has jurisdiction to entertain his application for discharge."
 In the Wilson case, referred to in the Ellery case, the petitioner, after eight months of confinement, applied to the trial court for a discharge under section 1143 et seq., of the Code of Civil Procedure. The court took evidence and denied the writ, on two grounds, one of which was that the sections have no application to contempt imprisonment predicated on the failure to pay alimony. The Supreme Court upheld the trial court for the first reason given by it for its denial, but, in view of the possibility of a new application being filed, undertook to determine the correctness of the second reason, and held it to be invalid. The Supreme Court first held that a contempt for failing to pay alimony is a "civil contempt" and the person imprisoned is in custody "under an execution." After citing several cases to support these conclusions, the court stated (p. 583): "We think, therefore, that if the petitioner shall make another application for discharge under the sections of the code above mentioned, it will be the duty of the superior judge to whom it shall be made to consider the case as coming within the provisions of those sections; to hear evidence touching his property and effects; to discharge the petitioner if he be satisfied from the evidence of his inability to pay; and to remand him if he be not so satisfied. To hold that the petitioner, though utterly penniless, must suffer a life imprisonment for debt because of the particular form in which the imprisonment was imposed, would be a gross violation of the plain intent of the code."
 Based on these cases, and for the reasons therein set forth, we conclude that the sections in question apply to one imprisoned for contempt predicated on a failure to pay alimony.
 [2] Counsel for Mrs. Johnson also contends that habeas corpus is not the proper remedy, and that if petitioner is entitled to any relief it must be by way of writ of mandamus to compel the trial court to administer the oath and to discharge the prisoner. While mandamus would undoubtedly be an appropriate remedy, it is not necessarily the exclusive *472 one. Here the petitioner has made a proper application. According to his uncontradicted and unimpeached testimony he is presently unable to pay the alimony award. There is no contention made that any other evidence but that of petitioner was introduced. On the face of the record the petitioner was entitled to his discharge. The present restraint of his person is illegal. He is being presently illegally restrained of his liberty. This being so, the petitioner should not be relegated to the remedy of mandamus, but is entitled to the much more expeditious remedy of habeas corpus.
 There being no legal justification for petitioner's further imprisonment, he is ordered discharged from custody and his bail is ordered exonerated.
 Ward, J., and Bray, J., concurred.
