-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpm2cpio.patch
More file actions
37 lines (33 loc) · 786 Bytes
/
rpm2cpio.patch
File metadata and controls
37 lines (33 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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