summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-04-04 21:52:41 +0200
committerhut <hut@lavabit.com>2011-04-05 17:03:57 +0200
commitd8084b41f67b1b8470251633529cacf2ba07fb6a (patch)
tree45dbb95b6ed4723804ca4fef2cb62a34c50f125a
parentc9023dbd5bee393da3f0913a2977f717270426af (diff)
downloadranger-d8084b41f67b1b8470251633529cacf2ba07fb6a.tar.gz
improved ranger.py
-rwxr-xr-xranger.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ranger.py b/ranger.py
index 240b3687..16c6b1b5 100755
--- a/ranger.py
+++ b/ranger.py
@@ -34,9 +34,10 @@ return 1
 """
 
 import sys
+import os.path
 
-# When using the --clean option, not even bytecode should be written.
-# Thus, we need to find out if --clean is used as soon as possible.
+# Need to find out whether or not the flag --clean was used ASAP,
+# because --clean is supposed to disable bytecode compilation
 try:
 	argv = sys.argv[0:sys.argv.index('--')]
 except:
@@ -46,6 +47,13 @@ sys.dont_write_bytecode = '-c' in argv or '--clean' in argv
 # Set the actual docstring
 __doc__ = """Ranger - file browser for the unix terminal"""
 
+# Don't import ./ranger when running an installed binary at /usr/bin/ranger
+if os.path.isdir('ranger'):
+	try:
+		sys.path.remove(os.path.abspath('.'))
+	except ValueError:
+		pass
+
 # Start ranger
 import ranger
 sys.exit(ranger.main())
<sir@cmpwn.com> 2019-03-17 17:47:35 -0400 committer Drew DeVault <sir@cmpwn.com> 2019-03-17 17:47:35 -0400 Add link to todo tracker' href='/akspecs/aerc/commit/README.md?h=0.5.0&id=b18e339a55dc2b6d459c93735320cdfc23115f56'>b18e339 ^
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
38
39