forked from hossainel/pyobfuscate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert everything to Python 3 using 2to3
Note that this code is non-functional, but makes it easier to see the changes done to get things Python 3 compliant.
- Loading branch information
1 parent
f944f92
commit 87cd72f
Showing
15 changed files
with
67 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
# pyobfuscate - Python source code obfuscator | ||
# | ||
# Copyright 2004-2007 Peter Astrand <[email protected]> for Cendio AB | ||
|
@@ -28,13 +28,13 @@ def get_origin_dir(): | |
|
||
|
||
def usage(): | ||
print >>sys.stderr, """ | ||
print(""" | ||
Install and obfuscate a Python file in one step. | ||
Usage: | ||
pyobfuscate-install [-m <mode>] [pyobfuscate-args] <source> <dest> | ||
""" | ||
""", file=sys.stderr) | ||
sys.exit(1) | ||
|
||
|
||
|
@@ -43,7 +43,7 @@ def main(): | |
usage() | ||
|
||
origin = get_origin_dir() | ||
mode = 0755 | ||
mode = 0o755 | ||
rest = [] | ||
next_is_mode = False | ||
for arg in sys.argv[1:]: | ||
|
@@ -63,7 +63,7 @@ def main(): | |
|
||
cmd = os.path.join(origin, "pyobfuscate") | ||
cmd += " " + source + " >" + dest | ||
print >>sys.stderr, "Calling", cmd | ||
print("Calling", cmd, file=sys.stderr) | ||
retcode = os.system(cmd) | ||
os.chmod(dest, mode) | ||
if retcode > 254: | ||
|
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
# | ||
# Execute the file with the same name as myself minus the extension. | ||
# Author: Peter Astrand <[email protected]> | ||
# | ||
import os, sys | ||
root, ext = os.path.splitext(sys.argv[0]) | ||
execfile(root) | ||
exec(compile(open(root, "rb").read(), root, 'exec')) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
DESCRIPTION = """\ | ||
Python source code obfuscator | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
|
Oops, something went wrong.