-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5651bc7
commit 76f7024
Showing
4 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/rpm2cpio.py b/rpm2cpio.py | ||
index e8e768d..06907e4 100755 | ||
--- a/rpm2cpio.py | ||
+++ b/rpm2cpio.py | ||
@@ -1,4 +1,4 @@ | ||
-#!/usr/bin/env python | ||
+#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Lightweight RPM to CPIO converter. | ||
@@ -20,16 +20,10 @@ rpm2cpio < adjtimex-1.20-2.1.i386.rpm | cpio -it | ||
133 blocks | ||
''' | ||
|
||
-from __future__ import print_function | ||
- | ||
import sys | ||
import gzip | ||
import subprocess | ||
- | ||
-try: | ||
- from StringIO import StringIO | ||
-except ImportError: | ||
- from io import StringIO | ||
+from io import BytesIO | ||
|
||
HAS_LZMA_MODULE = True | ||
try: | ||
@@ -47,7 +41,7 @@ XZ_MAGIC = b'\xfd7zXZ\x00' | ||
|
||
|
||
def gzip_decompress(data): | ||
- gzstream = StringIO(data) | ||
+ gzstream = BytesIO(data) | ||
gzipper = gzip.GzipFile(fileobj=gzstream) | ||
data = gzipper.read() | ||
return data |